From 8fd6f10544a7dbf360b1d665989ef78b9fcbc737 Mon Sep 17 00:00:00 2001 From: Sarisia Date: Fri, 24 Apr 2020 18:41:59 +0900 Subject: [PATCH] workflow: add release notify --- .github/workflows/release.yml | 74 ++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b942fe6..13b3de0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ env: TARGET: aria-discord-go jobs: - build: + release: name: Release runs-on: ubuntu-latest strategy: @@ -16,33 +16,45 @@ jobs: env: ASSET_NAME: aria-discord-go-${{ matrix.goos }}-amd64 steps: - - uses: actions/checkout@v1 - - uses: actions/setup-go@v1 - with: - go-version: 1.14.x - - run: mkdir aria-discord-go - - name: build - env: - GOOS: ${{ matrix.goos }} - GOARCH: amd64 - run: go build -ldflags "-X github.com/aria-music/aria-discord-go/aria.botVersion=${{ github.sha }}" -o aria-discord-go/ - - name: run release script - run: release/release.sh - - name: zip it - run: zip -r ${{ env.ASSET_NAME }}.zip aria-discord-go - - name: release - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.ASSET_NAME }}.zip - asset_name: ${{ env.ASSET_NAME }}.zip - asset_content_type: application/zip - - name: discord notify - if: always() - uses: sarisia/actions-status-discord@v1 - with: - webhook: ${{ secrets.DISCORD_WEBHOOK }} - status: ${{ job.status }} - job: ${{ env.TARGET }} - ${{ matrix.goos }} + - uses: actions/checkout@v1 + - uses: actions/setup-go@v1 + with: + go-version: 1.14.x + - run: mkdir aria-discord-go + - name: build + env: + GOOS: ${{ matrix.goos }} + GOARCH: amd64 + run: go build -ldflags "-X github.com/aria-music/aria-discord-go/aria.botVersion=${{ github.sha }}" -o aria-discord-go/ + - name: run release script + run: release/release.sh + - name: zip it + run: zip -r ${{ env.ASSET_NAME }}.zip aria-discord-go + - name: release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ env.ASSET_NAME }}.zip + asset_name: ${{ env.ASSET_NAME }}.zip + asset_content_type: application/zip + - name: discord notify + if: always() + uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + job: ${{ env.TARGET }} - ${{ matrix.goos }} + + notify: + needs: release + runs-on: ubuntu-latest + steps: + - uses: sarisia/actions-status-discord@v1 + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + color: 0xff7ac6 + nodetail: true + job: "New version is ready!" + description: "Release assets are ready!\n[Download](https://github.com/aria-music/aria-discord-go/releases)"