diff options
| author | TrainDoctor <traindoctor@protonmail.com> | 2022-09-04 18:18:51 -0700 |
|---|---|---|
| committer | TrainDoctor <traindoctor@protonmail.com> | 2022-09-04 18:18:51 -0700 |
| commit | 5f469bfb1628ffe17eb7921359682d6b24e380c4 (patch) | |
| tree | 1779e2f026957f761eee6f57112255a76bc648ca | |
| parent | acaf6c72e48e2bbb42b921292d49c1d157306d0b (diff) | |
| download | decky-loader-5f469bfb1628ffe17eb7921359682d6b24e380c4.tar.gz decky-loader-5f469bfb1628ffe17eb7921359682d6b24e380c4.zip | |
Merge ci-for-auto-update to main
| -rw-r--r-- | .github/workflows/build.yml | 98 | ||||
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | act/artifacts/readme | 10 | ||||
| -rw-r--r-- | act/prerelease.json | 5 | ||||
| -rw-r--r-- | act/release.json | 5 | ||||
| -rwxr-xr-x | act/run-act.sh | 44 |
6 files changed, 84 insertions, 82 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2518c6cd..458943f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,11 +54,18 @@ jobs: run: pyinstaller --noconfirm --onefile --name "PluginLoader" --add-data ./backend/static:/static --add-data ./backend/legacy:/legacy ./backend/*.py - name: Upload package artifact ⬆️ + if: ${{ !env.ACT }} uses: actions/upload-artifact@v3 with: name: PluginLoader path: ./dist/PluginLoader + - name: Download package artifact locally + if: ${{ env.ACT }} + uses: actions/upload-artifact@v3 + with: + path: ./dist/PluginLoader + release: name: Release the package if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'release' }} @@ -77,6 +84,7 @@ jobs: - 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 }} @@ -90,6 +98,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install semver-tool asdf + uses: asdf-vm/actions/install@v1 + with: + tool_versions: | + semver 3.3.0 + - name: Checkout 🧰 uses: actions/checkout@v3 @@ -98,13 +112,7 @@ jobs: with: name: PluginLoader path: dist - - - name: Install semver-tool asdf - uses: asdf-vm/actions/install@v1 - with: - tool_versions: | - semver 3.3.0 - + - name: Get tag 🏷️ id: old_tag uses: rafarlopes/get-latest-pre-release-tag-action@v1 @@ -124,89 +132,17 @@ jobs: - name: Push tag 📤 uses: rickstaa/action-create-tag@v1.3.2 - if: ${{ steps.ready_tag.outputs.tag_name && github.event_name == 'workflow_dispatch' }} + 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' }} + 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: true generate_release_notes: true - - # nightly: - # name: Release the nightly version of the package - # if: ${{ github.event_name == 'schedule' }} - # needs: build - # runs-on: ubuntu-latest - - # steps: - # - name: Checkout 🧰 - # uses: actions/checkout@v3 - - # - name: Fetch package artifact ⬇️ - # uses: actions/download-artifact@v3 - # with: - # name: PluginLoader - # path: dist - - # - name: Get tag 🏷️ - # id: old_tag - # uses: rafarlopes/get-latest-pre-release-tag-action@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # repository: 'decky-loader' - - # - name: Prepare tag ⚙️ - # id: ready_tag - # run: | - # export VERSION=${{ steps.old_tag.outputs.tag }} - # export COMMIT=$(git log -1 --pretty=format:%h) - # echo ::set-output name=tag_name::$(sed -r 's/(-.*)?-pre$//' <<< $VERSION)-$COMMIT-nightly - - # - name: Push tag 📤 - # uses: rickstaa/action-create-tag@v1.3.2 - # if: ${{ steps.ready_tag.outputs.tag_name && github.event_name == 'workflow_dispatch' }} - # with: - # tag: ${{ steps.ready_tag.outputs.tag_name }} - # message: Nightly ${{ steps.ready_tag.outputs.tag_name }} - - # - name: Release 📦 - # uses: softprops/action-gh-release@v1 - # if: ${{ github.event_name == 'workflow_dispatch' }} - # with: - # name: Prerelease ${{ steps.ready_tag.outputs.tag_name }} - # tag_name: ${{ steps.ready_tag.outputs.tag_name }} - # files: ./dist/PluginLoader - # prerelease: true - # generate_release_notes: true - - # - name: Bump prerelease ⏫ - # id: bump - # if: ${{ github.event_name == 'schedule' }} - # run: | - # git_hash=$(git rev-parse --short "$GITHUB_SHA") - # echo ::set-output new_tag="nightly-$git_hash" - - # - name: Push tag 📤 - # uses: rickstaa/action-create-tag@v1.3.2 - # if: ${{ github.event_name == 'schedule' }} - # with: - # tag: ${{ steps.bump.outputs.new_tag }} - # message: Nightly ${{ steps.bump.outputs.new_tag }} - - # - name: Release 📦 - # uses: softprops/action-gh-release@v1 - # if: ${{ github.event_name == 'schedule' }} - # with: - # name: Nightly ${{ steps.bump.outputs.new_tag }} - # tag_name: ${{ steps.bump.outputs.new_tag }} - # files: ./dist/PluginLoader - # prerelease: true - # generate_release_notes: true @@ -159,4 +159,6 @@ backend/static .vscode/settings.json # plugins folder for local launches -plugins/*
\ No newline at end of file +plugins/* +act/.directory +act/artifacts/*
\ No newline at end of file diff --git a/act/artifacts/readme b/act/artifacts/readme new file mode 100644 index 00000000..7540e736 --- /dev/null +++ b/act/artifacts/readme @@ -0,0 +1,10 @@ +this directory contains artifacts generated by invocations of https://github.com/nektos/act in order to do local testing of binary builds + +how to? +run: + +./act/run-act.sh prerelease + +or + +./act/run-act.sh release diff --git a/act/prerelease.json b/act/prerelease.json new file mode 100644 index 00000000..4ef0e8c7 --- /dev/null +++ b/act/prerelease.json @@ -0,0 +1,5 @@ +{ + "inputs": { + "release": "prerelease" + } +}
\ No newline at end of file diff --git a/act/release.json b/act/release.json new file mode 100644 index 00000000..fe400521 --- /dev/null +++ b/act/release.json @@ -0,0 +1,5 @@ +{ + "inputs": { + "release": "release" + } +}
\ No newline at end of file diff --git a/act/run-act.sh b/act/run-act.sh new file mode 100755 index 00000000..71a3d40c --- /dev/null +++ b/act/run-act.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +type=$1 + +oldartifactsdir="old" + +parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) +cd "$parent_path" + +artifactfolders=$(find artifacts/ -maxdepth 1 -mindepth 1 -type d) +if [[ ${#artifactfolders[@]} > 0 ]]; then + for i in ${artifactfolders[@]}; do + foldername=$(dirname $i) + subfoldername=$(basename $i) + out=$foldername/$oldartifactsdir/$subfoldername-$(date +'%s') + if [[ ! "$subfoldername" =~ "$oldartifactsdir" ]]; then + mkdir -p $out + mv $i $out + printf "Moved "${foldername}"/"${subfoldername}" to "${out}" \n" + fi + done +fi + +cd .. + +if [[ "$type" == "release" ]]; then + printf "release!\n" + act workflow_dispatch -e act/release.json --artifact-server-path act/artifacts +elif [[ "$type" == "prerelease" ]]; then + printf "prerelease!\n" + act workflow_dispatch -e act/prerelease.json --artifact-server-path act/artifacts +else + printf "Release type unspecified/badly specified.\n" + printf "Options: 'release' or 'prerelease'\n" +fi + +cd act/artifacts + +if [[ -d "1" ]]; then + cd "1/artifact" + cp "PluginLoader.gz__" "PluginLoader.gz" + gzip -d "PluginLoader.gz" + chmod +x PluginLoader +fi |
