-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 2.51 KB
/
release.yml
File metadata and controls
93 lines (81 loc) · 2.51 KB
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: '1.26.1'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
verify:
name: Verify Release
needs: release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
asset: openbao-secrets-importer_linux_amd64.tar.gz
binary: openbao-secrets-importer
- os: macos-latest
asset: openbao-secrets-importer_darwin_amd64.tar.gz
binary: openbao-secrets-importer
- os: windows-latest
asset: openbao-secrets-importer_windows_amd64.zip
binary: openbao-secrets-importer.exe
steps:
- name: Get release tag
id: tag
shell: bash
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Wait for release assets to be available
shell: bash
run: sleep 30
- name: Download release asset
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download "${{ steps.tag.outputs.tag }}" \
--repo "${{ github.repository }}" \
--pattern "${{ matrix.asset }}"
- name: Extract (tar.gz)
if: matrix.os != 'windows-latest'
run: tar -xzf "${{ matrix.asset }}"
- name: Extract (zip)
if: matrix.os == 'windows-latest'
run: unzip "${{ matrix.asset }}"
- name: Verify help text
shell: bash
run: |
chmod +x ./${{ matrix.binary }} 2>/dev/null || true
./${{ matrix.binary }} --help
./${{ matrix.binary }} version
- name: Verify subcommands
shell: bash
run: |
./${{ matrix.binary }} list --help
./${{ matrix.binary }} export --help
./${{ matrix.binary }} import --help
./${{ matrix.binary }} validate --help
./${{ matrix.binary }} sources