diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f70970ce6..a9d591934 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,12 +8,13 @@ on: jobs: changelog: runs-on: ubuntu-latest + outputs: + release_body: ${{ steps.git-cliff.outputs.content }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - ref: master token: ${{ secrets.REPO_TOKEN }} - name: Generate a changelog @@ -69,3 +70,26 @@ jobs: git commit -m "release(preparing): Update checksums.md5 📄" git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master fi + + release: + name: Create release + needs: + - checksums + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build + if: ${{ !contains(github.ref, '-') }} + run: cargo build --release + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/mything + asset_name: mything + file_glob: true + overwrite: true + tag: ${{ github.ref }} + release_name: "TorrentPier v${{ github.ref }}" + body: "${{ needs.generate-changelog.outputs.release_body }}"