Repository navigation
87 lines (81 loc) · 2.65 KB
/
Copy pathci.yml
File metadata and controls
87 lines (81 loc) · 2.65 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: embedledger-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
verify:
name: Verify (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: '1.27.1'
cache: false
- name: Test real resolver and CLI workflows
run: go test -count=1 ./...
- name: Vet
run: go vet ./...
- name: Build
run: go build ./...
- name: Check reviewed example assets
run: go run . check --goos linux --goarch amd64
- name: Require Go formatting
shell: bash
run: test -z "$(gofmt -l .)"
- name: Build and verify native distribution
run: go run ./scripts/package
- name: Keep verified native distribution
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: embedledger-native-${{ runner.os }}-${{ runner.arch }}
path: |
dist/embedledger_*.zip
dist/embedledger_*.zip.sha256
if-no-files-found: error
overwrite: true
race:
name: Race detector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: '1.27.1'
cache: false
- run: go test -race -count=1 ./...
publish:
name: Publish verified release
needs: [verify, race]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: embedledger-release
cancel-in-progress: false
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Read packages from this verified run
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
pattern: embedledger-native-*
path: release-artifacts
merge-multiple: true
- name: Publish complete packages
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const publish = require('./scripts/release.cjs');
await publish({ github, context, core });