From 0523ac6afc806bd02e9372d580dc2212708fddbd Mon Sep 17 00:00:00 2001 From: thinkgos Date: Tue, 30 Jan 2024 09:28:52 +0800 Subject: [PATCH] fix: fix release bug --- .github/workflows/release.yml | 116 ++++++++++++++++++---------------- 1 file changed, 63 insertions(+), 53 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9384e49..97d1eb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,48 +24,48 @@ jobs: os: ubuntu-latest name: goup-x86_64-unknown-linux-gnu.tar.gz - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - name: goup-x86_64-unknown-linux-musl.tar.gz - - - target: i686-unknown-linux-musl - os: ubuntu-latest - name: goup-i686-unknown-linux-musl.tar.gz - - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - name: goup-aarch64-unknown-linux-musl.tar.gz - - - target: arm-unknown-linux-musleabihf - os: ubuntu-latest - name: goup-arm-unknown-linux-musleabihf.tar.gz - - - target: x86_64-apple-darwin - os: macOS-11 - name: goup-x86_64-apple-darwin.tar.gz - - - target: aarch64-apple-darwin - os: macOS-11 - name: goup-aarch64-apple-darwin.tar.gz - - - target: x86_64-pc-windows-msvc - os: windows-latest - name: goup-x86_64-pc-windows-msvc.zip - rustflags: -C target-feature=+crt-static - - - target: i686-pc-windows-msvc - os: windows-latest - name: goup-i686-pc-windows-msvc.zip - rustflags: -C target-feature=+crt-static -# TODO: bug ring not supported -# - target: aarch64-pc-windows-msvc -# os: windows-latest -# name: goup-aarch64-pc-windows-msvc.zip -# rustflags: -C target-feature=+crt-static - - - target: x86_64-unknown-freebsd - os: ubuntu-latest - name: goup-x86_64-unknown-freebsd.tar.gz +# - target: x86_64-unknown-linux-musl +# os: ubuntu-latest +# name: goup-x86_64-unknown-linux-musl.tar.gz + +# - target: i686-unknown-linux-musl +# os: ubuntu-latest +# name: goup-i686-unknown-linux-musl.tar.gz + +# - target: aarch64-unknown-linux-musl +# os: ubuntu-latest +# name: goup-aarch64-unknown-linux-musl.tar.gz + +# - target: arm-unknown-linux-musleabihf +# os: ubuntu-latest +# name: goup-arm-unknown-linux-musleabihf.tar.gz + +# - target: x86_64-apple-darwin +# os: macOS-11 +# name: goup-x86_64-apple-darwin.tar.gz + +# - target: aarch64-apple-darwin +# os: macOS-11 +# name: goup-aarch64-apple-darwin.tar.gz + +# - target: x86_64-pc-windows-msvc +# os: windows-latest +# name: goup-x86_64-pc-windows-msvc.zip +# rustflags: -C target-feature=+crt-static + +# - target: i686-pc-windows-msvc +# os: windows-latest +# name: goup-i686-pc-windows-msvc.zip +# rustflags: -C target-feature=+crt-static +# # TODO: bug ring not supported +# # - target: aarch64-pc-windows-msvc +# # os: windows-latest +# # name: goup-aarch64-pc-windows-msvc.zip +# # rustflags: -C target-feature=+crt-static + +# - target: x86_64-unknown-freebsd +# os: ubuntu-latest +# name: goup-x86_64-unknown-freebsd.tar.gz runs-on: ${{ matrix.os }} continue-on-error: true @@ -120,7 +120,7 @@ jobs: if: matrix.os != 'windows-latest' run: | cd target/${{ matrix.target }}/release - tar czvf ../../../${{ matrix.name }} goup + tar -czvf ../../../${{ matrix.name }} goup cd - - name: Release | Upload artifacts @@ -137,28 +137,38 @@ jobs: name: goup-${{ matrix.target }}.msi path: target/wix/goup-${{ matrix.target }}.msi - # Create GitHub release with Rust build targets and release notes - upload_artifacts: - name: Add Build Artifacts to Release - needs: [github_build] - runs-on: ubuntu-latest - steps: - - name: Generate a changelog + - name: Generate a changelog [Changelog] uses: orhun/git-cliff-action@v2 + if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' with: config: cliff.toml args: --latest env: OUTPUT: CHANGELOG.md + - name: Upload changelog artifacts [Changelog] + if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu' + uses: actions/upload-artifact@v4 + with: + name: CHANGELOG.tar.gz + path: CHANGELOG.md + + # Create GitHub release with Rust build targets and release notes + upload_artifacts: + name: Add Build Artifacts to Release + needs: [github_build] + runs-on: ubuntu-latest + steps: - name: Setup | Artifacts uses: actions/download-artifact@v4 - name: Setup | Checksums - run: for file in goup-*/goup-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done - + run: | + for file in goup-*/goup-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done + tar -zxvf CHANGELOG.tar.gz + - name: Build | Add Artifacts to Release uses: softprops/action-gh-release@v1 with: - body_path: CHANGELOG.md + body_path: goup-rs/CHANGELOG.md files: goup-*/goup-* \ No newline at end of file