forked from nitanmarcel/cinny-click-packaging
-
-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (73 loc) · 3.07 KB
/
Copy pathrelease_github.yml
File metadata and controls
78 lines (73 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# this file will build the app, create a downloadable artifact, publish the app to OpenStore and create a release with the build app as asset
name: build and github release
on:
# start the script when a tag is pushed ending with RC (no underline before RC, that will fail linting)
# tag format: v1.2.3.4RC
# note: GitHub Actions does not support full regex in tag patterns; it uses simple glob patterns like *, ?, and [] instead.
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
push:
tags:
- 'v*.*.*.*RC'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
# define the build job
jobs:
build:
strategy:
matrix:
arch: [amd64, arm64, armhf]
appname: [cinny.danfro]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4 # here @latest doesn't work, specific version v4 or above
with:
submodules: 'true'
- name: Extract NVM version from prebuild.sh
id: extract-nvm-version
run: echo "NVM_VERSION=$(grep -oP '(?<=NVM_VERSION=)[^ ]+' prebuild.sh)" >> $GITHUB_ENV
- name: Extract node version from prebuild.sh
id: extract-node-version
run: echo "NODE_VERSION=$(grep -oP '(?<=NODE_VERSION=)[^ ]+' prebuild.sh)" >> $GITHUB_ENV
- name: Set up Node.js environment
run: |
export NVM_DIR="$HOME/.nvm"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash
. "$NVM_DIR/nvm.sh" # Source nvm
nvm install $NODE_VERSION
nvm use $NODE_VERSION
echo "Node.js $(node -v) installed via nvm"
- name: Set Artifact Version
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
ARTIFACT_VERSION=${TAG_NAME#v}
echo "ARTIFACT_VERSION=$ARTIFACT_VERSION" >> $GITHUB_ENV
echo "Set ARTIFACT_VERSION=$ARTIFACT_VERSION"
- name: Debug ARTIFACT_VERSION
run: echo "ARTIFACT_VERSION=$ARTIFACT_VERSION"
env:
ARTIFACT_VERSION: ${{ env.ARTIFACT_VERSION }}
- name: Install clickable
run: |
python3 -m pip install clickable-ut
- name: Build
# build the app with clickable for all specified architectures
run: |
clickable build --arch ${{ matrix.arch }}
- name: Upload artifacts
# upload the build artifacts to github using the appname and version
uses: actions/upload-artifact@v4 # here @latest doesn't work, specific version v4 or above
with:
name: ${{ matrix.appname }}_${{ matrix.arch }}
path: build/*/app/*.click
if-no-files-found: error
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2 # https://github.com/softprops/action-gh-release
with:
files: build/*/app/*.click
body: "${{ github.event.head_commit.message }}" # Grab the last commit message as changelog
prerelease: true