From 329ac8ea3bf12ef99eaa442c5209da128d43104f Mon Sep 17 00:00:00 2001 From: Nick <117028104+HilkopterBob@users.noreply.github.com> Date: Sat, 26 Oct 2024 12:36:51 +0200 Subject: [PATCH] ci: dynamically get release url --- .github/workflows/nightly_release.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly_release.yml b/.github/workflows/nightly_release.yml index 29783db..bd47b86 100644 --- a/.github/workflows/nightly_release.yml +++ b/.github/workflows/nightly_release.yml @@ -22,6 +22,17 @@ jobs: id: version run: echo "APP_VERSION=nightly-build:$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "nightly" + release_name: "Nightly Builds" + draft: false + prerelease: true + - name: Build Go Application run: | mkdir -p ${{ github.workspace }}/packagelock @@ -36,7 +47,7 @@ jobs: - name: Calculate Checksum run: | - md5sum ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz | cut -f 1 -d " " > ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64.tar.gz.md5 + md5sum ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz | cut -f 1 -d " " > ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz.md5 - name: Upload Release Tarball id: upload-release-asset @@ -44,7 +55,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: https://api.github.com/repos/HilkopterBob/PackageLock/releases/180504390/assets + upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz asset_name: packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz asset_content_type: application/gzip @@ -55,7 +66,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: https://api.github.com/repos/HilkopterBob/PackageLock/releases/180504390/assets + upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./release/packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz.md5 asset_name: packagelock-${{ env.APP_VERSION }}-linux-amd64-nightly.tar.gz.md5 asset_content_type: text/plain \ No newline at end of file