|
| 1 | +# This workflow is useful if you want to automate the process of: |
| 2 | +# |
| 3 | +# a) Creating a new prelease when you push a new tag with a "v" prefix (version). |
| 4 | +# |
| 5 | +# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases. |
| 6 | +# After the prerelease is created, you need to make your changes on the release page at the relevant |
| 7 | +# Github page and publish your release. |
| 8 | +# |
| 9 | +# b) Creating/updating the "latest" prerelease when you push to your default branch. |
| 10 | +# |
| 11 | +# This type of prelease is useful to make your bleeding-edge binaries available to advanced users. |
| 12 | +# |
| 13 | +# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your |
| 14 | +# default branch. |
| 15 | +on: push |
| 16 | + |
| 17 | +jobs: |
| 18 | + might_release: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v2 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Prepare Release Variables |
| 27 | + id: vars |
| 28 | + uses: ignite/cli/actions/release/vars@main |
| 29 | + |
| 30 | + - name: Issue Release Assets |
| 31 | + uses: ignite/cli/actions/cli@main |
| 32 | + if: ${{ steps.vars.outputs.should_release == 'true' }} |
| 33 | + with: |
| 34 | + args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 |
| 35 | + |
| 36 | + - name: Delete the "latest" Release |
| 37 | + uses: dev-drprasad/[email protected] |
| 38 | + if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }} |
| 39 | + with: |
| 40 | + tag_name: ${{ steps.vars.outputs.tag_name }} |
| 41 | + delete_release: true |
| 42 | + env: |
| 43 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + |
| 45 | + - name: Publish the Release |
| 46 | + uses: softprops/action-gh-release@v1 |
| 47 | + if: ${{ steps.vars.outputs.should_release == 'true' }} |
| 48 | + with: |
| 49 | + tag_name: ${{ steps.vars.outputs.tag_name }} |
| 50 | + files: release/* |
| 51 | + prerelease: true |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments