From 743a90302870fa667dcb453eda4be9a2890e5454 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Mon, 15 Apr 2024 17:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=20CI=20=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "更新actions/checkout至v4" This reverts commit 53a2694c5b32f2b229c8c38a913e19d277ce4026. Revert "CI更改artifact名称并不再使用matrix" This reverts commit be8dab99932eaaa5bca609a962e7a6be14ab69c4. Revert "CI自动发布native image二进制文件" This reverts commit 0292e57829a6705237284a750e09c78476c62ef9. --- .github/workflows/jvm.yml | 4 +-- .github/workflows/native.yml | 59 +++++++++++------------------------- 2 files changed, 19 insertions(+), 44 deletions(-) diff --git a/.github/workflows/jvm.yml b/.github/workflows/jvm.yml index 7f40b3a24e..fa603f473b 100644 --- a/.github/workflows/jvm.yml +++ b/.github/workflows/jvm.yml @@ -19,7 +19,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 - uses: graalvm/setup-graalvm@v1 name: Setup GraalVM with: @@ -31,7 +31,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: Linux-${{ github.sha }} + name: build-artifacts ${{ matrix.version }} on ${{ matrix.os }} path: | target/*.jar target/peerbanhelper-binary diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 8c7f1f1f69..dc1d563457 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -17,10 +17,14 @@ on: - published jobs: build-unix-like: - name: build unix like - runs-on: ubuntu-latest + name: ${{ matrix.version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + version: [ latest ] + os: [ ubuntu-latest ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - uses: graalvm/setup-graalvm@v1 with: java-version: '22' @@ -34,7 +38,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: Linux-${{ github.sha }} + name: build-artifacts ${{ matrix.version }} on ${{ matrix.os }} path: | target/PeerBanHelper.jar target/peerbanhelper-binary @@ -65,10 +69,14 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}-native-linux build-windows: - name: build windows - runs-on: windows-latest + name: ${{ matrix.version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + version: [ latest ] + os: [ windows-latest ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v2 - uses: graalvm/setup-graalvm@v1 with: java-version: '22' @@ -83,40 +91,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: Windows-${{ github.sha }} + name: build-artifacts ${{ matrix.version }} on ${{ matrix.os }} path: | target/PeerBanHelper.jar - target/peerbanhelper-binary.exe - - release: - name: Release - runs-on: ubuntu-latest - needs: [build-unix-like,build-windows] - if: startsWith(github.ref, 'refs/tags/') - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts - - name: Zip - working-directory: ./artifacts - run: | - for dir in ./*; do - if [ -d $dir ]; then - os="$(echo ${dir##*/} |cut -d- -f1)" - zip -rj "PeerBanHelper.${{ github.event.release.tag_name }}.$os.zip" $dir/* - rm -rf $dir - fi - done - - name: Create release - uses: ncipollo/release-action@v1 - with: - artifacts: "artifacts/*.zip" - name: ${{ github.event.release.tag_name }} - omitNameDuringUpdate: true - tag: ${{ github.event.release.tag_name }} - allowUpdates: true - artifactErrorsFailBuild: true + target/peerbanhelper-binary.exe \ No newline at end of file