|
| 1 | +# NOTE: This file comes from `savi-lang/base-standard-library` |
| 2 | +# |
| 3 | +# This workflow is responsible for automating the creation of a new release. |
| 4 | +# As an input, the workflow takes a version tag to apply to the latest commit. |
| 5 | +# The version tag name will also be the release's name in GitHub. |
| 6 | +# Release notes will auto-generated by GitHub based on Pull Requests history. |
| 7 | +# |
| 8 | +# With some minor modification (see comments in the job definition below), |
| 9 | +# this workflow can also build release binaries for all supported platforms, |
| 10 | +# and package them up as tarballs attached as assets to the release in GitHub. |
| 11 | +# This is not relevant for all libraries, because many libraries do not have |
| 12 | +# any executable binary that is relevant to build, so it is disabled by default, |
| 13 | +# but for those libraries that have one or more application binaries to build, |
| 14 | +# all you need to do is specify the binary manifest's name and enable that step. |
| 15 | +# |
| 16 | +# The workflow is triggered by workflow dispatch, which means to run it you |
| 17 | +# need to press the "Run Workflow" button on the Actions page for this workflow, |
| 18 | +# then enter the required inputs when prompted to do so. |
| 19 | +# It can also be triggered via the GitHub API if desired. |
| 20 | + |
| 21 | +name: library-release |
| 22 | + |
| 23 | +on: |
| 24 | + pull_request: # (only to verify that the release build is working in PRs) |
| 25 | + workflow_dispatch: |
| 26 | + inputs: |
| 27 | + version-tag: |
| 28 | + description: | |
| 29 | + The name of the version to release (e.g. `v1.2.3` or `v0.20220131.0`). |
| 30 | + required: true |
| 31 | + |
| 32 | +jobs: |
| 33 | + all: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v2 |
| 37 | + - uses: savi-lang/action-install@v1 |
| 38 | + |
| 39 | + - uses: savi-lang/action-build-release@v1 |
| 40 | + # Remove the following `if: false` line and replace all occurrences of |
| 41 | + # `my-app` placeholder with your application's bin manifest name |
| 42 | + # to enable building release binaries for your application. |
| 43 | + if: false |
| 44 | + id: my-app |
| 45 | + with: |
| 46 | + manifest-name: my-app |
| 47 | + tarball-name: my-app-${{ github.event.inputs.version-tag }} |
| 48 | + all-platforms: true |
| 49 | + macosx-accept-license: true |
| 50 | + windows-accept-license: true |
| 51 | + |
| 52 | + - uses: softprops/action-gh-release@v1 |
| 53 | + if: ${{ github.event.inputs.version-tag != '' }} |
| 54 | + with: |
| 55 | + tag_name: ${{ github.event.inputs.version-tag }} |
| 56 | + generate_release_notes: true |
| 57 | + token: ${{ secrets.BOT_GITHUB_TOKEN }} # (allows triggering workflows) |
| 58 | + |
| 59 | + # Uncomment the following lines to upload release binaries. |
| 60 | + # fail_on_unmatched_files: true |
| 61 | + # files: | |
| 62 | + # ${{ steps.my-app.outputs.tarball-directory }}/* |
0 commit comments