From 099588665af7d2438630286a64c17efe5e2e33ed Mon Sep 17 00:00:00 2001 From: Damien Zhao Date: Fri, 16 May 2025 18:14:00 +0800 Subject: [PATCH] add release workflow Signed-off-by: Damien Zhao --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..52a06dd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: Release + +on: + issue_comment: + types: [ created ] + +jobs: + build_and_release: + name: Build and release + runs-on: ubuntu-latest + container: devkitpro/devkita64:latest + if: contains(github.event.comment.body, '/release-action') + + steps: + - name: Update packages + run: | + sudo -n apt-get update + sudo -n apt-get upgrade -y git build-essential + sudo -n apt-get install -y zip python3 python3-pip python3-lz4 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 + shell: bash + - name: Update latest libnx + run: | + git config --global --add safe.directory "*" + git clone --recurse-submodules https://github.com/zdm65477730/libnx.git + cd libnx + make install -j$(nproc) + shell: bash + - name: Checkout latest code + uses: actions/checkout@v4.1.1 + with: + ref: master + clean: true + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Setup ENV parameters + run: | + VER_FILE=Makefile + VERSION=$(awk '/^LPVERSION_MAJOR/{print $3}' $VER_FILE).$(awk '/^LPVERSION_MINOR/{print $3}' $VER_FILE).$(awk '/^LPVERSION_BUGFX/{print $3}' $VER_FILE) + echo "TAG=${VERSION}-with-sigpatch" >> "${GITHUB_ENV}" + echo "RELEASE_NAME=CommonProblemResolver ${VERSION}" >> "${GITHUB_ENV}" + shell: bash + - name: Build + run: | + export DEVKITPRO=/opt/devkitpro + make -f atmosphere.mk dist-no-debug + shell: bash + - name: Upload Release Asset + uses: softprops/action-gh-release@v2.0.9 + with: + name: ${{ env.RELEASE_NAME }} + tag_name: ${{ env.TAG }} + draft: false + prerelease: false + generate_release_notes: yes + make_latest: true + files: | + output/CommonProblemResolver.bin \ No newline at end of file