Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
workflow: add release notify
Browse files Browse the repository at this point in the history
  • Loading branch information
sarisia committed Apr 24, 2020
1 parent 0ebaf4f commit 8fd6f10
Showing 1 changed file with 43 additions and 31 deletions.
74 changes: 43 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
TARGET: aria-discord-go

jobs:
build:
release:
name: Release
runs-on: ubuntu-latest
strategy:
Expand All @@ -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/[email protected]
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/[email protected]
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)"

0 comments on commit 8fd6f10

Please sign in to comment.