diff options
Diffstat (limited to '.github/workflows/ferdi-builds.yml')
-rw-r--r-- | .github/workflows/ferdi-builds.yml | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index 3e53d4e71..5bc20ff23 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml | |||
@@ -41,22 +41,31 @@ jobs: | |||
41 | steps: | 41 | steps: |
42 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' | 42 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' |
43 | uses: actions/checkout@v2 | 43 | uses: actions/checkout@v2 |
44 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 44 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }} |
45 | with: | 45 | with: |
46 | ref: nightly | 46 | ref: nightly |
47 | submodules: recursive | 47 | submodules: recursive |
48 | fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging | 48 | fetch-depth: 0 # Note: Needed to be able to pull the 'develop' branch as well for merging |
49 | - id: should_run | 49 | - id: should_run |
50 | name: Check whether there are any commits since this run was last triggered and push them and/or set the output | 50 | name: Check whether there are any commits since this run was last triggered and push them and/or set the output |
51 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch')) }} | 51 | if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }} |
52 | run: | | 52 | run: | |
53 | git config user.name github-actions | 53 | git config user.name github-actions |
54 | git config user.email github-actions@github.com | 54 | git config user.email github-actions@github.com |
55 | 55 | ||
56 | CHANGES_COUNT=$(git diff --shortstat origin/develop | wc -l) | ||
57 | if [ $CHANGES_COUNT -gt 0 ] || [ {{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[version bump]') }} ]; then | ||
58 | # Do the version bump in the 'develop' branch ONLY if there were other changes coming from the 'develop' branch | ||
59 | git checkout develop | ||
60 | npm version -m "%s [skip ci]" prerelease --preid=nightly | ||
61 | git push origin develop | ||
62 | |||
63 | git checkout nightly | ||
64 | fi | ||
65 | |||
56 | echo "Merge with fast-forward from 'origin/develop'" | 66 | echo "Merge with fast-forward from 'origin/develop'" |
57 | git merge --ff-only origin/develop --no-verify | 67 | git merge --ff-only origin/develop --no-verify |
58 | 68 | ||
59 | CHANGES_COUNT=$(git diff --shortstat origin/nightly | wc -l) | ||
60 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" | 69 | MANUAL_REBUILD="${{ github.event_name == 'workflow_dispatch' }}" |
61 | echo "Number of changes: $CHANGES_COUNT" | 70 | echo "Number of changes: $CHANGES_COUNT" |
62 | if [ $CHANGES_COUNT -eq 0 ] && [ $MANUAL_REBUILD != "true" ]; then | 71 | if [ $CHANGES_COUNT -eq 0 ] && [ $MANUAL_REBUILD != "true" ]; then |
@@ -70,7 +79,7 @@ jobs: | |||
70 | build_mac: | 79 | build_mac: |
71 | name: 'macos ${{ github.event.inputs.message }}' | 80 | name: 'macos ${{ github.event.inputs.message }}' |
72 | needs: check_updates | 81 | needs: check_updates |
73 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, 'macOS') || (!contains(github.event.inputs.message, 'macOS') && !contains(github.event.inputs.message, 'Linux') && !contains(github.event.inputs.message, 'Windows'))))) }} | 82 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[macOS]') || (!contains(github.event.inputs.message, '[macOS]') && !contains(github.event.inputs.message, '[Linux]') && !contains(github.event.inputs.message, '[Windows]'))))) }} |
74 | runs-on: macos-10.15 | 83 | runs-on: macos-10.15 |
75 | steps: | 84 | steps: |
76 | - name: Set env vars | 85 | - name: Set env vars |
@@ -78,7 +87,7 @@ jobs: | |||
78 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV | 87 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV |
79 | echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV | 88 | echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV |
80 | echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV | 89 | echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV |
81 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV | 90 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV |
82 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV | 91 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV |
83 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch | 92 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch |
84 | uses: actions/checkout@v2 | 93 | uses: actions/checkout@v2 |
@@ -167,7 +176,7 @@ jobs: | |||
167 | build_linux: | 176 | build_linux: |
168 | name: 'ubuntu ${{ github.event.inputs.message }}' | 177 | name: 'ubuntu ${{ github.event.inputs.message }}' |
169 | needs: check_updates | 178 | needs: check_updates |
170 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, 'Linux') || (!contains(github.event.inputs.message, 'macOS') && !contains(github.event.inputs.message, 'Linux') && !contains(github.event.inputs.message, 'Windows'))))) }} | 179 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[Linux]') || (!contains(github.event.inputs.message, '[macOS]') && !contains(github.event.inputs.message, '[Linux]') && !contains(github.event.inputs.message, '[Windows]'))))) }} |
171 | runs-on: ubuntu-20.04 | 180 | runs-on: ubuntu-20.04 |
172 | steps: | 181 | steps: |
173 | - name: Set env vars | 182 | - name: Set env vars |
@@ -175,7 +184,7 @@ jobs: | |||
175 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV | 184 | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV |
176 | echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV | 185 | echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV |
177 | echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV | 186 | echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV |
178 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV | 187 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV |
179 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV | 188 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV |
180 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch | 189 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch |
181 | uses: actions/checkout@v2 | 190 | uses: actions/checkout@v2 |
@@ -254,7 +263,7 @@ jobs: | |||
254 | build_windows: | 263 | build_windows: |
255 | name: 'windows ${{ github.event.inputs.message }}' | 264 | name: 'windows ${{ github.event.inputs.message }}' |
256 | needs: check_updates | 265 | needs: check_updates |
257 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, 'Windows') || (!contains(github.event.inputs.message, 'macOS') && !contains(github.event.inputs.message, 'Linux') && !contains(github.event.inputs.message, 'Windows'))))) }} | 266 | if: ${{ (needs.check_updates.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[Windows]') || (!contains(github.event.inputs.message, '[macOS]') && !contains(github.event.inputs.message, '[Linux]') && !contains(github.event.inputs.message, '[Windows]'))))) }} |
258 | runs-on: windows-2019 | 267 | runs-on: windows-2019 |
259 | steps: | 268 | steps: |
260 | - name: Set env vars | 269 | - name: Set env vars |
@@ -263,7 +272,7 @@ jobs: | |||
263 | echo "NPM_CACHE=$USERPROFILE\.npm" >> $GITHUB_ENV | 272 | echo "NPM_CACHE=$USERPROFILE\.npm" >> $GITHUB_ENV |
264 | echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV | 273 | echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV |
265 | echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV | 274 | echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV |
266 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, 'nightly branch') }}" >> $GITHUB_ENV | 275 | echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV |
267 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV | 276 | echo "SKIP_NOTARIZATION=${{ !contains(github.repository_owner, 'getferdi') }}" >> $GITHUB_ENV |
268 | shell: bash | 277 | shell: bash |
269 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch | 278 | - name: Checkout code along with submodules for the 'nightly' branch if the trigger event is 'scheduled' or this is a forced rebuild on the nightly branch |