diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a0a7951 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: release +on: + push: + branches: [ main ] + paths: [ "src/version.cr" ] + workflow_dispatch: + +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)" + + - name: install crystal + uses: crystal-lang/install-crystal@v1.8.2 + with: + crystal: ${{ steps.crystal-version.outputs.crystal }} + + - name: bootstrap + run: script/bootstrap + + - 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 + mv ./bin/runway ./releases/runway-linux-x86_64 + + - name: Push a Release + id: release + uses: ncipollo/release-action@v1.14.0 + with: + artifacts: "./releases/*" + tag: ${{ env.VERSION }} + generateReleaseNotes: true + artifactErrorsFailBuild: true + replacesArtifacts: true + + - name: release url + env: + RELEASE_URL: ${{ steps.release.outputs.html_url }} + run: | + echo "release url: $RELEASE_URL" diff --git a/src/version.cr b/src/version.cr index 7e79edd..86620e3 100644 --- a/src/version.cr +++ b/src/version.cr @@ -1,3 +1,3 @@ module Runway - VERSION = "v0.1.0" + VERSION = "v0.0.1" end