Skip to content

Commit

Permalink
Merge pull request spinframework#294 from bacongobbler/bump-upload-ar…
Browse files Browse the repository at this point in the history
…tifact

fix release upload process
  • Loading branch information
bacongobbler authored Mar 30, 2022
2 parents 64984ff + 1ee0401 commit 3d90f6f
Showing 1 changed file with 68 additions and 4 deletions.
72 changes: 68 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,31 @@ jobs:
args: "--all-features --release ${{ matrix.config.extraArgs }}"

- name: package release assets
shell: bash
if: runner.os != 'Windows'
run: |
mkdir _dist
cp readme.md LICENSE ${{ matrix.config.targetDir }}/spin${{ matrix.config.extension }} _dist/
cd _dist
tar czf spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz readme.md LICENSE spin${{ matrix.config.extension }}
zip -r spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip readme.md LICENSE spin${{ matrix.config.extension }}
shasum -a 256 *.tar.gz *.zip > checksums-${{ env.RELEASE_VERSION }}.txt
- name: package release assets
if: runner.os == 'Windows'
shell: bash
run: |
mkdir _dist
cp readme.md LICENSE ${{ matrix.config.targetDir }}/spin${{ matrix.config.extension }} _dist/
cd _dist
tar czf spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz readme.md LICENSE spin${{ matrix.config.extension }}
7z a -tzip spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip readme.md LICENSE spin${{ matrix.config.extension }}
- name: upload binary as GitHub artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: spin
path: |
_dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
_dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip
_dist/checksums-${{ env.RELEASE_VERSION }}.txt
# TODO: actually update/override the canary release each time
# See https://github.com/fermyon/spin/issues/128
Expand All @@ -132,3 +140,59 @@ jobs:
body: |
This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**.
It is only intended for developers wishing to try out the latest features in Spin, some of which may not be fully implemented.
- name: upload binary to canary GitHub release
uses: svenstaro/[email protected]
if: github.ref == 'refs/heads/main'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: _dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip
asset_name: spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.zip
tag: canary
overwrite: true
prerelease: true
body: |
This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**.
It is only intended for developers wishing to try out the latest features in Spin, some of which may not be fully implemented.
checksums:
name: generate release checksums
runs-on: ubuntu-latest
needs: build
steps:
- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: set the release version (main)
if: github.ref == 'refs/heads/main'
shell: bash
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV

- name: download release assets
uses: actions/download-artifact@v3
with:
name: spin

- name: generate checksums
run: sha256sum * > checksums-${{ env.RELEASE_VERSION }}.txt

- uses: actions/upload-artifact@v3
with:
name: spin
path: checksums-${{ env.RELEASE_VERSION }}.txt

- name: upload checksums to canary GitHub release
uses: svenstaro/[email protected]
if: github.ref == 'refs/heads/main'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: checksums-${{ env.RELEASE_VERSION }}.txt
asset_name: checksums-${{ env.RELEASE_VERSION }}.txt
tag: canary
overwrite: true
prerelease: true
body: |
This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**.
It is only intended for developers wishing to try out the latest features in Spin, some of which may not be fully implemented.

0 comments on commit 3d90f6f

Please sign in to comment.