From 26029c204c17ee6fa74a7e8ca8bb1fcff2560761 Mon Sep 17 00:00:00 2001 From: H1rono Date: Tue, 24 Dec 2024 22:56:28 +0900 Subject: [PATCH] :wrench: Add release asset of `.crate` file --- .github/workflows/release.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f24d264..fdae078 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,17 +25,35 @@ jobs: fi done echo "contains=false" >> "$GITHUB_OUTPUT" + prepare-assets: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cargo package -l + - run: | + cargo package --no-verify -p traq-bot-http + mv target/package/*.crate traq-bot-http.crate + - uses: actions/upload-artifact@v4 + with: + name: package + path: traq-bot-http.crate create-release: runs-on: ubuntu-latest - needs: check-main-branch + needs: + - prepare-assets + - check-main-branch if: needs.check-main-branch.outputs.contains == 'true' steps: - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: package - uses: actions/setup-python@v5 with: python-version: '3.10' - run: | release_note="$(cat CHANGELOG.md | python3 .github/workflows/filter-changelog.py '${{ github.ref_name }}')" gh release create ${{ github.ref_name }} -d -t ${{ github.ref_name }} -n "$release_note" + gh release upload ${{ github.ref_name }} traq-bot-http.crate env: GH_TOKEN: ${{ secrets.PAT }}