From abde65491b6459e5cede2ad91702176c839a5f53 Mon Sep 17 00:00:00 2001 From: Ryan Geary Date: Sun, 16 Aug 2020 09:36:40 -0400 Subject: [PATCH] Add GitHub action to create GitHub release --- .github/workflows/crates.yml | 22 ---------------- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/crates.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/crates.yml b/.github/workflows/crates.yml deleted file mode 100644 index d4cd86e..0000000 --- a/.github/workflows/crates.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Crates.io Release - -on: - push: - tags: - - v* - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Check style - run: cargo fmt -- --check - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Publish - run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..824e2c3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Create Releases + +on: + push: + tags: + - v* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Check style + run: cargo fmt -- --check + + - name: Build + run: cargo build --verbose --release + + - name: Run tests + run: cargo test --verbose + + - name: Create GitHub 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 }} + body: '' + draft: false + prerelease: false + + - name: Upload binary to GitHub release + id: upload-release-asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create-release.outputs.upload_url }} + asset_path: target/release/choose + asset_name: choose + asset_content_type: application/raw + + - name: Create crates.io release + run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}