From 2f72fa1cd83764ab8385512662f75a5544a6bc9e Mon Sep 17 00:00:00 2001 From: Leechael Yim Date: Thu, 17 Oct 2024 10:26:00 +0800 Subject: [PATCH] cont. --- .github/workflows/ci.yml | 52 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c29d04..a7a5d07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,18 @@ on: default: false jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + release-type: rust + package-name: your-package-name + build: name: Build and Test runs-on: ${{ matrix.os }} @@ -71,24 +83,19 @@ jobs: cargo --version rustc --version - create-release: - needs: build + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ runner.os }}-build + path: target/release/* + + upload-release-assets: + needs: [release-please, build] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') + if: ${{ needs.release-please.outputs.release_created }} steps: - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v2 - name: Calculate MD5 checksums run: | @@ -97,21 +104,10 @@ jobs: done - name: Upload Release Assets - uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./checksums.md5 - asset_name: checksums.md5 - asset_content_type: text/plain - - - name: Upload Binaries to Release - uses: AButler/upload-release-assets@v2.0 - with: - files: '*-build/*' - repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ github.ref }} + run: | + gh release upload ${{ needs.release-please.outputs.tag_name }} checksums.md5 *-build/* --clobber - name: Debug log if: ${{ github.event.inputs.debug_enabled == 'true' }}