-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: add tagged release workflow (#206)
- Loading branch information
1 parent
9a9ffa0
commit 192e4b0
Showing
3 changed files
with
100 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
docker: | ||
name: docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Set Tag | ||
uses: actions/github-script@v4 | ||
id: set_tag | ||
with: | ||
script: | | ||
const tag = context.ref.replace('refs/tags/v', '') | ||
core.setOutput('tag', tag) | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
context: . | ||
file: ./cmd/shovel/Dockerfile | ||
push: true | ||
tags: indexsupply/shovel:${{ steps.set_tag.outputs.tag }} | ||
bins: | ||
name: binaries | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cmd: [shovel] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.21" | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Set Tag | ||
uses: actions/github-script@v4 | ||
id: set_tag | ||
with: | ||
script: | | ||
const tag = context.ref.replace('refs/tags/v', '') | ||
core.setOutput('tag', tag) | ||
- uses: ./.github/actions/release | ||
id: go-run-release | ||
with: | ||
cmd: ${{ matrix.cmd }} -tag ${{ steps.set_tag.outputs.tag }} | ||
dist: ${{ secrets.AWS_DISTRIBUTION_ID }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-west-2' |
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