Skip to content

Add v1.0.0 release workflow and publish to ghcr.io #1

Add v1.0.0 release workflow and publish to ghcr.io

Add v1.0.0 release workflow and publish to ghcr.io #1

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: go test -race -count=1 ./...
- name: Build binary
run: CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o coldkey ./cmd/coldkey
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build \
--build-arg VERSION=${{ github.ref_name }} \
-t ghcr.io/${{ github.repository }}:${{ github.ref_name }} \
-t ghcr.io/${{ github.repository }}:latest \
.
docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
docker push ghcr.io/${{ github.repository }}:latest
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: coldkey