-
Notifications
You must be signed in to change notification settings - Fork 70
72 lines (65 loc) · 1.99 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
name: release
on:
workflow_run:
workflows: ["Github workflow test"]
types: [completed]
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
build-and-push-image:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@master
with:
registry: ghcr.io
username: davidkhala
password: ${{ secrets.TWGC_DAVIDKHALA }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@master
with:
images: ghcr.io/hyperledger-twgc/tape
tags: |
type=ref,event=tag
- if: github.ref == 'refs/heads/master'
name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/s390x
push: true
tags: ghcr.io/hyperledger-twgc/tape
labels: ${{ steps.meta.outputs.labels }}
build-and-release-binary:
if: startsWith(github.event.ref, 'refs/tags/')
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- run: GOOS=$(go env GOOS) GOARCH=$(go env GOARCH) make tape
shell: bash
- run: cp tape tape-${{runner.os}}-${{runner.arch}}
- name: Release
uses: softprops/action-gh-release@master
with:
files: |
tape-${{runner.os}}-${{runner.arch}}
config.yaml