mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 00:42:01 +00:00
Added handling for release to pre-release, pre-rel to rel and rel to rel
This commit is contained in:
+62
-40
@@ -67,46 +67,12 @@ jobs:
|
|||||||
path: ./dist/PluginLoader
|
path: ./dist/PluginLoader
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release the package
|
name: Release stable version of the package
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'release' }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'release' }}
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout 🧰
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Fetch package artifact ⬇️
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: PluginLoader
|
|
||||||
path: dist
|
|
||||||
|
|
||||||
- name: Release 📦
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
if: ${{ !env.ACT }}
|
|
||||||
with:
|
|
||||||
name: Release ${{ steps.tag_version.outputs.new_tag }}
|
|
||||||
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
|
||||||
files: ./dist/PluginLoader
|
|
||||||
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' }}
|
|
||||||
needs: build
|
|
||||||
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 🧰
|
- name: Checkout 🧰
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -127,7 +93,7 @@ jobs:
|
|||||||
uses: rez0n/actions-github-release@main
|
uses: rez0n/actions-github-release@main
|
||||||
id: latest_release
|
id: latest_release
|
||||||
env:
|
env:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
repository: "SteamDeckHomebrew/decky-loader"
|
repository: "SteamDeckHomebrew/decky-loader"
|
||||||
type: "nodraft"
|
type: "nodraft"
|
||||||
|
|
||||||
@@ -136,16 +102,71 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export VERSION=${{ steps.latest_release.outputs.release }}
|
export VERSION=${{ steps.latest_release.outputs.release }}
|
||||||
echo "VERS: $VERSION"
|
echo "VERS: $VERSION"
|
||||||
OUT=""
|
OUT="notsemver"
|
||||||
OUT=$(semver bump prerel "$VERSION")
|
if [[ "$VERSION" =~ "-pre" ]]; then
|
||||||
printf "OUT: ${OUT}\n"
|
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 "vOUT: v$OUT"
|
||||||
echo ::set-output name=tag_name::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: ${{ github.event_name == 'workflow_dispatch' && !env.ACT }}
|
||||||
|
with:
|
||||||
|
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' }}
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- 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 ⚙️
|
- name: Prepare tag ⚙️
|
||||||
id: ready_tag
|
id: ready_tag
|
||||||
run: |
|
run: |
|
||||||
export VERSION=${{ steps.old_tag.outputs.tag }}
|
export VERSION="2.0.5"
|
||||||
echo "VERS: $VERSION"
|
echo "VERS: $VERSION"
|
||||||
OUT=""
|
OUT=""
|
||||||
if [[ ! "$VERSION" =~ "-pre" ]]; then
|
if [[ ! "$VERSION" =~ "-pre" ]]; then
|
||||||
@@ -157,6 +178,7 @@ jobs:
|
|||||||
elif [[ "$VERSION" =~ "-pre" ]]; then
|
elif [[ "$VERSION" =~ "-pre" ]]; then
|
||||||
printf "is a prerelease, bumping prerel\n"
|
printf "is a prerelease, bumping prerel\n"
|
||||||
OUT=$(semver bump prerel "$VERSION")
|
OUT=$(semver bump prerel "$VERSION")
|
||||||
|
printf "OUT: ${OUT}\n"
|
||||||
fi
|
fi
|
||||||
echo ::set-output name=tag_name::v$OUT
|
echo ::set-output name=tag_name::v$OUT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user