This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
forked from 0xPolygon/polygon-edge
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (56 loc) · 1.81 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
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
echo release_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $GITHUB_RELEASE_TIME
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Run GoReleaser
run: |
echo $(date -u +"%Y-%m-%dT%H:%M:%SZ") >> $RELEASE_TIME
docker run \
--rm \
--privileged \
-e CGO_ENABLED=1 \
-e GITHUB_TOKEN \
-e SLACK_WEBHOOK \
-e GITHUB_REF_NAME=${GITHUB_REF_NAME} \
-e GITHUB_SHA=${GITHUB_SHA} \
-e GITHUB_REF=${GITHUB_REF} \
-e RELEASE_TIME=${RELEASE_TIME} \
-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 }}
GITHUB_REF_NAME: ${{ GITHUB_REF_NAME }}