Merge pull request #48 from runwaylab/reactions #15
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
name: release | |
on: | |
push: | |
branches: [main] | |
paths: ["src/version.cr"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: fetch crystal version | |
id: crystal-version | |
run: echo "crystal=$(cat .crystal-version)" >> $GITHUB_OUTPUT | |
- name: install crystal | |
uses: crystal-lang/install-crystal@cdf26dcd488490c9939e9d4d62cab169c9e4f20d # pin@v1.8.2 | |
with: | |
crystal: ${{ steps.crystal-version.outputs.crystal }} | |
- name: bootstrap | |
run: script/bootstrap --ci | |
- name: fetch version | |
run: | | |
export RELEASE_VERSION=$(grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' src/version.cr) | |
echo "VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV | |
- name: test | |
run: script/test | |
- name: build (linux x86_64) | |
run: | | |
mkdir -p releases | |
script/build --production | |
mv ./bin/runway ./releases/runway-linux-x86_64 | |
- name: generate artifact attestation | |
uses: actions/attest-build-provenance@v2.1.0 | |
with: | |
subject-path: 'releases/runway-*' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: runway-binaries | |
path: releases/ | |
- uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # pin@v1.11.1 | |
id: app-token | |
with: | |
app-id: ${{ vars.APP_ID }} | |
private-key: ${{ secrets.PRIVATE_KEY }} | |
- name: Push a Release | |
id: release | |
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # pin@v1.15.0 | |
with: | |
artifacts: "./releases/*" | |
tag: ${{ env.VERSION }} | |
generateReleaseNotes: true | |
artifactErrorsFailBuild: true | |
replacesArtifacts: true | |
token: ${{ steps.app-token.outputs.token }} | |
- name: release url | |
env: | |
RELEASE_URL: ${{ steps.release.outputs.html_url }} | |
run: | | |
echo "release url: $RELEASE_URL" |