Skip to content

.github: add tagged release workflow (#206) #28

.github: add tagged release workflow (#206)

.github: add tagged release workflow (#206) #28

Workflow file for this run

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'