Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

ci: push docker image on release (#27) #9

ci: push docker image on release (#27)

ci: push docker image on release (#27) #9

Workflow file for this run

---
name: Release
on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- "**"
tags:
- "v*.*.*"
# to be used by fork patch-releases ^^
- "v*.*.*-*"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo tag_name=${TAG} >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Run GoReleaser
run: |
docker run \
--rm \
--privileged \
-e CGO_ENABLED=1 \
-e GITHUB_TOKEN \
-e SLACK_WEBHOOK \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate
env:
PACKAGE_NAME: github.com/topos-protocol/polygon-edge
GOLANG_CROSS_VERSION: v1.20.5
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}