Skip to content

v0.0.11

v0.0.11 #19

Workflow file for this run

name: Release
on:
release:
types: [created]
jobs:
build-and-deploy-docker:
name: Build and Deploy
permissions:
contents: read
packages: write
attestations: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: olegtarasov/get-tag@v2.1
id: tag-name
- name: Get Git Info
id: git_info
run: |
last_commit_time=$(git log -1 --format=%cd --date=iso)
echo "last_commit_time=$last_commit_time" >> $GITHUB_ENV
echo "Last commit time is $last_commit_time"
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ env.GIT_TAG_NAME }}
COMMIT_TIME=${{ env.last_commit_time }}
labels: |
org.opencontainers.image.version=${{ env.GIT_TAG_NAME }}
org.opencontainers.image.created=${{ env.last_commit_time }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG_NAME }}
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goarch: "arm64"
goos: windows
steps:
- uses: actions/checkout@v3
- name: Get Git Info
id: git_info
run: |
last_commit_time=$(git log -1 --format=%cd --date=iso)
echo "last_commit_time=$last_commit_time" >> $GITHUB_ENV
echo "Last commit time is $last_commit_time"
- uses: wangyoucao577/go-release-action@v1
env:
RELEASE_NAME: ${{ env.GIT_TAG_NAME }}
with:
github_token: ${{ secrets.TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz"
project_path: "./cmd"
executable_compression: upx
sha256sum: true
ldflags: "-X 'main.version=${{ env.GIT_TAG_NAME }}' -X 'main.commitTime=${{env.last_commit_time}}' -s -w -extldflags '-static'"
binary_name: "omni-balance"