Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add goreleaser config to disable default windows builds enabled via g… #11

Add goreleaser config to disable default windows builds enabled via g…

Add goreleaser config to disable default windows builds enabled via g… #11

Workflow file for this run

name: Publish Binaries and Images
on:
push:
branches-ignore:
- '**'
tags:
- 'v*'
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
permissions:
contents: write
packages: write
jobs:
images:
name: Release
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }}
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version-file: 'go.mod'
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Setup Docker Environment
id: vars
uses: ./.github/actions/setup-docker-environment
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/[email protected]
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
variantdev/mod:latest
variantdev/mod:${{ steps.get_version.outputs.VERSION }}
variantdev/mod:${{ steps.get_version.outputs.VERSION }}-${{ steps.vars.outputs.sha_short }}
ghcr.io/variantdev/mod:latest
ghcr.io/variantdev/mod:${{ steps.get_version.outputs.VERSION }}
ghcr.io/variantdev/mod:${{ steps.get_version.outputs.VERSION }}-${{ steps.vars.outputs.sha_short }}
cache-from: type=gha
cache-to: type=gha,mode=max
binaries:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/[email protected]
-
name: Set up Go
uses: actions/[email protected]
with:
go-version-file: 'go.mod'
-
name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}