From b1e861a7a9d1c4d60b4ed00a600275ce80d417d0 Mon Sep 17 00:00:00 2001 From: suxb201 Date: Fri, 23 Sep 2022 11:39:51 +0800 Subject: [PATCH] Create release.yml --- .github/release-drafter.yml | 6 ++++++ .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..17aab4f --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,6 @@ +name-template: 'redis-shake-v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..147c4d8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +# Controls when the workflow will run +on: + push: + branches: + - master + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Golang with cache + uses: magnetikonline/action-golang-cache@v3 + with: + go-version-file: go.mod + + - name: Build + run: bash build.sh dist + + - name: "Draft release" + id: "release" + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Upload release asset" + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release.outputs.upload_url }} + asset_path: ./bin/redis-shake.tar.gz + asset_name: redis-shake.tar.gz + asset_content_type: application/gzip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}