-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
532a331
commit ef65de5
Showing
7 changed files
with
102 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,75 @@ | ||
{} | ||
package workflows | ||
|
||
import "encoding/json" | ||
|
||
SlackBlockRelease: { | ||
"blocks": [ | ||
{ | ||
"type": "section" | ||
"text": { | ||
"type": "mrkdwn" | ||
"text": "A new version of `whaturl` has been released: `${{ github.event.release.tag_name }}` :tada:" | ||
} | ||
"accessory": { | ||
"type": "button" | ||
"text": { | ||
"type": "plain_text" | ||
"text": "See details" | ||
} | ||
"url": "${{ github.event.release.html_url }}" | ||
} | ||
}, | ||
] | ||
} | ||
|
||
goreleaser: { | ||
|
||
name: "GoReleaser" | ||
|
||
on: push: tags: [ | ||
"*", | ||
] | ||
|
||
permissions: contents: "write" | ||
|
||
jobs: { | ||
|
||
goreleaser: { | ||
"runs-on": "ubuntu-latest" | ||
steps: [{ | ||
name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
with: "fetch-depth": 0 | ||
}, { | ||
name: "Fetch all tags" | ||
run: "git fetch --force --tags" | ||
}, { | ||
name: "Set up Go" | ||
uses: "actions/setup-go@v2" | ||
with: "go-version": 1.18 | ||
}, { | ||
name: "Run GoReleaser" | ||
uses: "goreleaser/goreleaser-action@v3" | ||
with: { | ||
distribution: "goreleaser" | ||
version: "latest" | ||
args: "release --rm-dist" | ||
} | ||
env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
}] | ||
} | ||
|
||
notify: { | ||
name: "Perform Slack notification" | ||
"runs-on": "ubuntu-latest" | ||
steps: [ | ||
#SlackAction & { | ||
with: { | ||
payload: json.Marshal(SlackBlockRelease) | ||
} | ||
}, | ||
] | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
--- | ||
name: GoReleaser | ||
|
||
on: | ||
"on": | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Fetch all tags | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- | ||
name: Set up Go | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- | ||
name: Run GoReleaser | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v3 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
notify: | ||
name: Perform Slack notification | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: slackapi/slack-github-action@v1.21.0 | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
channel-id: workflows | ||
payload: '{"blocks":[{"type":"section","text":{"type":"mrkdwn","text":"A new version of `whaturl` has been released: `${{ github.event.release.tag_name }}` :tada:"},"accessory":{"type":"button","text":{"type":"plain_text","text":"See details"},"url":"${{ github.event.release.html_url }}"}}]}' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,9 @@ workflows: [ | |
filename: "vale.yml" | ||
workflow: vale | ||
}, | ||
{ | ||
filename: "goreleaser.yml" | ||
workflow: goreleaser | ||
}, | ||
|
||
] |