-
Notifications
You must be signed in to change notification settings - Fork 23
103 lines (87 loc) · 2.92 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
permissions:
contents: write
packages: write
jobs:
release-binaries-github:
name: Release Binaries to Github
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Generate Release Files (darwin/arm64)
run: make release-darwin-arm64
- name: Generate Release Files (darwin/amd64)
run: make release-darwin-amd64
- name: Generate Release Files (linux/arm64)
run: make release-linux-arm64
- name: Generate Release Files (linux/amd64)
run: make release-linux-amd64
- name: Publish to Github
uses: softprops/action-gh-release@v1
with:
files: release/*
prerelease: false
generate_release_notes: true
publish-docker:
name: Publish Docker Image (linux/amd64)
runs-on: ubuntu-latest
needs: release-binaries-github
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
version: latest
- name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Docker Metadata
id: docker-build
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository}}
flavor: |
latest=auto
tags: |
type=semver,pattern={{version}},value=${{ env.LATEST_RELEASE_TAG }}
labels: |
org.opencontainers.image.vendor="Hypermine Limited"
org.opencontainers.image.title="Hypersign Identity Network"
org.opencontainers.image.description="A permissionless blockchain network to manage digital identity and access rights"
org.opencontainers.image.source="https://github.com/hypersign-protocol/hid-node"
org.opencontainers.image.documentation="https://docs.hypersign.id"
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.docker-build.outputs.tags }}
labels: ${{ steps.docker-build.outputs.labels }}