From 04d8ada15ab17a1fb975df7b298f2858428fab9a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 24 Sep 2022 12:08:20 +0200 Subject: [PATCH] Automatically create a pre-release for each merge to master (#41) --- .github/workflows/build.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c52012e..b138615 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,10 +39,11 @@ jobs: - name: Get git hash run: | - echo -n "https://github.com/${GITHUB_REPOSITORY}/commit/" > src/runtime/version - git rev-parse --short HEAD | xargs >> src/runtime/version + VERSION="$(date --utc +%Y-%m-%d)-$(git rev-parse --short HEAD)" + echo -n "https://github.com/${GITHUB_REPOSITORY}/releases/tag/build-${VERSION}" > src/runtime/version + echo "${VERSION}" > tag.txt - - name: Build + - name: Build (x86) if: contains(matrix.qemu_arch, 'x86') env: ARCHITECTURE: ${{ matrix.appimage_arch }} @@ -59,18 +60,17 @@ jobs: dockerRunArgs: | --volume "${PWD}/out:/out" --volume "${PWD}/src:/src" - run: | - ./build.sh - # echo "artifactName=$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - uses: actions/upload-artifact@v3 + run: ./build.sh + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 with: name: artifacts path: ./out/* - - name: Upload to releases + - name: Create Release if: github.event_name != 'pull_request' && github.ref_name == 'master' - uses: softprops/action-gh-release@v1 - with: - files: out/* - tag_name: continuous - + run: | + VERSION="$(cat tag.txt)" + gh release create --prerelease --title "Build ${VERSION}" "build-${VERSION}" out/* \ + || gh release upload "build-${VERSION}" out/*