-
Notifications
You must be signed in to change notification settings - Fork 70
83 lines (76 loc) · 2.45 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
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@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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@v6
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@v5
with:
go-version-file: go.mod
- 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
- name: Generate SBOM
uses: anchore/sbom-action@v0.17.9
with:
path: ./
artifact-name: tape-${{ steps.meta.outputs.labels }}.json
output-file: ./tape-${{ steps.meta.outputs.labels }}.spdx.json
- name: Attach SBOM to release
uses: softprops/action-gh-release@v2
with:
tag_name: tape-${{ steps.meta.outputs.labels }}
files: ./tape-${{ steps.meta.outputs.labels }}.spdx.json