From 9d8a91d73778a9a5e9f8734c85df82234459a344 Mon Sep 17 00:00:00 2001 From: Samuel <36420837+Samueru-sama@users.noreply.github.com> Date: Sat, 21 Dec 2024 02:19:07 -0400 Subject: [PATCH] make versioned releases --- .github/workflows/blank.yml | 68 +++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 0e40eab..aa4060b 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -24,29 +24,77 @@ jobs: mkdir dist mv *AppImage dist/ + - name: Check version file + run: | + cat ~/version + echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}" + - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.4.3 with: - name: Android-Tools.AppImage + name: AppImage path: 'dist' + - name: Upload version file + uses: actions/upload-artifact@v4.4.3 + with: + name: version + path: ~/version + release: needs: [build] permissions: write-all runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4.1.8 + with: + name: AppImage + - uses: actions/download-artifact@v4.1.8 + with: + name: version + + - name: Read version + run: | + cat version + export VERSION="$(> "${GITHUB_ENV}" + + #Version Release + - name: Del Previous Release + run: | + gh release delete "${APP_VERSION}" --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y + env: + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + continue-on-error: true + - name: Continuous Releaser + uses: softprops/action-gh-release@v2 with: - name: Android-Tools.AppImage + name: "Android Tools AppImage ${{ env.APP_VERSION}}" + tag_name: "${{ env.APP_VERSION}}" + prerelease: false + draft: false + generate_release_notes: false + make_latest: true + files: | + *.AppImage* + continue-on-error: false - - name: release - uses: marvinpinto/action-automatic-releases@latest + #Snapshot Release + - name: Get Date + run: | + SNAPSHOT_TAG="$(date --utc +'%Y%m%d-%H%M%S')" + echo SNAPSHOT_TAG="${SNAPSHOT_TAG}" >> "${GITHUB_ENV}" + continue-on-error: false + - name: Snapshot Releaser + uses: softprops/action-gh-release@v2 with: - title: Continuous build - automatic_release_tag: continuous + name: "Snapshot ${{ env.APP_VERSION}}" + tag_name: "${{ env.SNAPSHOT_TAG}}" prerelease: false draft: false + generate_release_notes: false + make_latest: false files: | - *.AppImage - repo_token: ${{ secrets.GITHUB_TOKEN }} + *.AppImage* + continue-on-error: false