diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2022-09-05 20:03:09 -0700 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2022-09-05 20:03:09 -0700 |
| commit | 6347ad08566928cc0d5810acecfde9bbd5e39c26 (patch) | |
| tree | 3a63d80ab892d0790ce2cddbab53738a74953a00 /.github/workflows/build.yml | |
| parent | 1377d830230a356167d34b80f0fce7468e51ad26 (diff) | |
| download | decky-loader-6347ad08566928cc0d5810acecfde9bbd5e39c26.tar.gz decky-loader-6347ad08566928cc0d5810acecfde9bbd5e39c26.zip | |
Added handling for release to pre-release, pre-rel to rel and rel to relv2.1.0-pre1
Diffstat (limited to '.github/workflows/build.yml')
| -rw-r--r-- | .github/workflows/build.yml | 76 |
1 files changed, 49 insertions, 27 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5c0e284..310f4fa6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,7 @@ jobs: path: ./dist/PluginLoader release: - name: Release the package + name: Release stable version of the package if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'release' }} needs: build runs-on: ubuntu-latest @@ -76,21 +76,62 @@ jobs: - name: Checkout 🧰 uses: actions/checkout@v3 + - name: Install semver-tool asdf + uses: asdf-vm/actions/install@v1 + with: + tool_versions: | + semver 3.3.0 + - name: Fetch package artifact ⬇️ uses: actions/download-artifact@v3 + if: ${{ !env.ACT }} with: name: PluginLoader path: dist + - name: Get latest release + uses: rez0n/actions-github-release@main + id: latest_release + env: + # token: ${{ secrets.GITHUB_TOKEN }} + repository: "SteamDeckHomebrew/decky-loader" + type: "nodraft" + + - name: Prepare tag ⚙️ + id: ready_tag + run: | + export VERSION=${{ steps.latest_release.outputs.release }} + echo "VERS: $VERSION" + OUT="notsemver" + if [[ "$VERSION" =~ "-pre" ]]; then + printf "is prerelease, bumping to release\n" + OUT=$(semver bump release "$VERSION") + printf "OUT: ${OUT}\n" + elif [[ ! "$VERSION" =~ "-pre" ]]; then + printf "previous tag is a release, bumping by a patch\n" + OUT=$(semver bump minor "$VERSION") + printf "OUT: ${OUT}\n" + fi + echo "vOUT: v$OUT" + echo ::set-output name=tag_name::v$OUT + + - name: Push tag 📤 + uses: rickstaa/action-create-tag@v1.3.2 + if: ${{ steps.ready_tag.outputs.tag_name && github.event_name == 'workflow_dispatch' && !env.ACT }} + with: + tag: ${{ steps.ready_tag.outputs.tag_name }} + message: Pre-release ${{ steps.ready_tag.outputs.tag_name }} + - name: Release 📦 uses: softprops/action-gh-release@v1 - if: ${{ !env.ACT }} + if: ${{ github.event_name == 'workflow_dispatch' && !env.ACT }} with: - name: Release ${{ steps.tag_version.outputs.new_tag }} - tag_name: ${{ steps.tag_version.outputs.new_tag }} + name: Prerelease ${{ steps.ready_tag.outputs.tag_name }} + tag_name: ${{ steps.ready_tag.outputs.tag_name }} files: ./dist/PluginLoader + prerelease: false generate_release_notes: true - + prerelease: name: Release the pre-release version of the package if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'prerelease' }} @@ -98,15 +139,6 @@ jobs: runs-on: ubuntu-latest steps: - # - name: Configure semver plugin - # run: | - # asdf global semver 3.3.0 - - # - name: Test semver - # uses: asdf-vm/actions/plugin-test@v1 - # with: - # command: semver --version - - name: Checkout 🧰 uses: actions/checkout@v3 @@ -127,25 +159,14 @@ jobs: uses: rez0n/actions-github-release@main id: latest_release env: - token: ${{ secrets.GITHUB_TOKEN }} + # token: ${{ secrets.GITHUB_TOKEN }} repository: "SteamDeckHomebrew/decky-loader" type: "nodraft" - name: Prepare tag ⚙️ id: ready_tag run: | - export VERSION=${{ steps.latest_release.outputs.release }} - echo "VERS: $VERSION" - OUT="" - OUT=$(semver bump prerel "$VERSION") - printf "OUT: ${OUT}\n" - echo "vOUT: v$OUT" - echo ::set-output name=tag_name::v$OUT - - - name: Prepare tag ⚙️ - id: ready_tag - run: | - export VERSION=${{ steps.old_tag.outputs.tag }} + export VERSION="2.0.5" echo "VERS: $VERSION" OUT="" if [[ ! "$VERSION" =~ "-pre" ]]; then @@ -157,6 +178,7 @@ jobs: elif [[ "$VERSION" =~ "-pre" ]]; then printf "is a prerelease, bumping prerel\n" OUT=$(semver bump prerel "$VERSION") + printf "OUT: ${OUT}\n" fi echo ::set-output name=tag_name::v$OUT |
