From 14f9ac4ca75f513e6c6f95ac985524cedb455eab Mon Sep 17 00:00:00 2001 From: Spike <19519553+spikecodes@users.noreply.github.com> Date: Fri, 26 Mar 2021 21:48:00 +0000 Subject: [PATCH] Automatically draft a release on push --- .github/workflows/rust.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c6790d8..dfc47b5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,9 +21,24 @@ jobs: - name: Build run: cargo build --release - - - uses: actions/upload-artifact@v2.2.1 - name: Upload a Build Artifact + + - name: Versions + id: version + run: | + echo "::set-output name=version::$(cargo metadata --format-version 1 --no-deps | jq .packages[0].version -r | sed 's/^/v/')" + echo "::set-output name=tag::${GITHUB_REF#refs/*/}" + + - name: Release + uses: softprops/action-gh-release@v1 with: - name: libreddit - path: target/release/libreddit + tag_name: ${{ steps.version.outputs.version }} + name: ${{ steps.version.outputs.version }} - NAME + draft: true + files: target/release/libreddit + fail_on_unmatched_files: true + body: | + - CHANGES + + See full list of changes [here](https://github.com/spikecodes/libreddit/compare/${{ steps.version.outputs.tag }}...${{ steps.version.outputs.version }}). + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}