forked from godotjs/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve pipeline to publish release builds (godotjs#170)
* feat: improve pipeline to publish release builds * fix: issues with workflows * refactor: publish process * fix: overwrite godot master to 4.1 because the api changed from 4.1->4.2 * fix: issue with wrong version name for release
- Loading branch information
Showing
3 changed files
with
154 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: π¦ Release Builds | ||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
rename: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: β¬ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: π Add version to release name | ||
uses: actions/github-script@v6 | ||
with: | ||
result-encoding: json | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const date = new Date(); | ||
const year = date.getFullYear().toString(); | ||
const month = (date.getMonth() + 1).toString().padStart(2,"0"); | ||
const day = (date.getDay() + 1).toString().padStart(2,"0"); | ||
await github.rest.repos.updateRelease({ | ||
owner, | ||
repo, | ||
release_id: context.payload.release.id, | ||
name: '${{ inputs.version }}-' + context.payload.release.name + '-' + year + month + day, | ||
}); | ||
release: | ||
runs-on: ubuntu-latest | ||
name: ${{ matrix.name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: | ||
- android-template | ||
- ios-template | ||
- linux-editor-mono | ||
- linux-template-minimal | ||
- linux-template-mono | ||
- macos-editor | ||
- macos-template | ||
- web-template | ||
- windows-editor | ||
- windows-template | ||
steps: | ||
- name: β¬ Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: β¬ Download build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ matrix.name }} | ||
path: ${{ matrix.name }} | ||
|
||
- name: π¦ Pack build as zip | ||
run: zip -r ${{ matrix.name }}.zip ${{ matrix.name }} | ||
shell: bash | ||
|
||
- name: β« Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/github-script@v6 | ||
with: | ||
result-encoding: json | ||
script: | | ||
const FS = require('node:fs') | ||
const { repo, owner } = context.repo; | ||
return await github.rest.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id: context.payload.release.id, | ||
name: '${{ matrix.name }}.zip', | ||
data: FS.readFileSync('${{ github.workspace }}/${{ matrix.name }}.zip') | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters