From 4a6c80aa3e3567370783fef67694e8869dda15a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hermann=20H=C3=B6hne?= Date: Thu, 26 Sep 2024 00:53:32 +0200 Subject: [PATCH] Produce a "nightly" release on every push. --- .github/workflows/build.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5a751a..b1c223f 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,11 @@ jobs: build: runs-on: windows-2022 + + permissions: + id-token: write + contents: write # This is required to create/push the new git tag + steps: - uses: actions/checkout@v4 with: @@ -43,3 +48,21 @@ jobs: with: path: build/Release/libpresage.dll name: libpresage.dll + + - name: Prepare Release Info + run: | + $COMMIT_DATE = (git log -1 --date=format:'%Y%m%d' --format='%ad') + echo "COMMIT_DATE=$COMMIT_DATE" | Out-File -FilePath $Env:GITHUB_ENV -Append + [string](Get-Content "src\rust\Cargo.toml") -match 'presage = [^}]+rev = \"([a-f0-9]+)\"' | Out-Null + $PRESAGE_REVISION = $matches[1] + echo "PRESAGE_REVISION=$PRESAGE_REVISION" | Out-File -FilePath $Env:GITHUB_ENV -Append + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: build/Release/libpresage.dll + tag: nightly-${{ env.COMMIT_DATE }}-${{ env.PRESAGE_REVISION }} + #name: Nightly ${{ github.sha }} + allowUpdates: true + artifactErrorsFailBuild: true + makeLatest: true