From 32e46ef7dc537b4197a0c7e3372514cac23f7801 Mon Sep 17 00:00:00 2001 From: kotcrab <4594081+kotcrab@users.noreply.github.com> Date: Sun, 16 Jun 2024 16:35:15 +0200 Subject: [PATCH] Unified workflow --- .github/workflows/build.yml | 32 +++++++++++++++++++++----- .github/workflows/publish.yml | 42 ----------------------------------- 2 files changed, 26 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3834160..27a52ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,16 @@ name: Build Ghidra Allegrex -on: [ push, pull_request, workflow_dispatch ] +on: + push: + branches: + - '**' + tags: + - 'v*' + pull_request: + workflow_dispatch: + +permissions: + contents: write jobs: build: @@ -10,24 +20,34 @@ jobs: ghidra: [ '11.0.3', '11.1', '11.1.1' ] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin cache: gradle - name: Setup Ghidra - uses: antoniovazquezblanco/setup-ghidra@v1.2.4 + uses: antoniovazquezblanco/setup-ghidra@021eb688b995b2c3aa4d607dea9cb332ab4eb9c8 with: version: ${{ matrix.ghidra }} - name: Build Extension run: | chmod +x gradlew ./gradlew buildExtension - - name: Upload artifact - uses: actions/upload-artifact@v3 + - name: Upload artifact to workflow + uses: actions/upload-artifact@v4 with: path: dist/*ghidra-allegrex.zip name: ghidra-allegrex-snapshot-for-Ghidra-${{ matrix.ghidra }} if-no-files-found: error + - name: Upload artifact to release + if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') + uses: svenstaro/upload-release-action@2.9.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: ghidra-allegrex ${{ github.ref_name }} + file: dist/*ghidra-allegrex.zip + file_glob: true + body: See [CHANGES](https://github.com/kotcrab/ghidra-allegrex/blob/master/CHANGES.md) file before updating. + tag: ${{ github.ref }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 0509280..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Publish Ghidra Allegrex - -on: - push: - tags: - - 'v*' - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - ghidra: [ '11.0.3', '11.1', '11.1.1' ] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Java - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - cache: gradle - - name: Setup Ghidra - uses: antoniovazquezblanco/setup-ghidra@v1.2.4 - with: - version: ${{ matrix.ghidra }} - - name: Build Extension - run: | - chmod +x gradlew - ./gradlew buildExtension - - name: Upload artifact to release - uses: svenstaro/upload-release-action@2.9.0 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - release_name: ghidra-allegrex ${{ github.ref_name }} - file: dist/*ghidra-allegrex.zip - file_glob: true - body: See [CHANGES](https://github.com/kotcrab/ghidra-allegrex/blob/master/CHANGES.md) file before updating. - tag: ${{ github.ref }}