Skip to content

Commit 3b2f4ac

Browse files
committed
ci: fix release workflow and disable validation
1 parent 6e10b91 commit 3b2f4ac

3 files changed

Lines changed: 23 additions & 347 deletions

File tree

.github/workflows/release.yaml

Lines changed: 21 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,46 @@
11
name: "Release"
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
27
on:
38
push:
4-
# take no actions on push to any branch...
5-
branches-ignore:
6-
- "**"
7-
# ... only act on release tags
9+
branches:
10+
- "main"
811
tags:
912
- "v*"
13+
pull_request:
1014

1115
env:
12-
GO_VERSION: "1.18.x"
16+
GO_VERSION: "1.18"
1317

1418
jobs:
15-
quality-gate:
16-
environment: release
17-
runs-on: ubuntu-latest # This OS choice is arbitrary. None of the steps in this job are specific to either Linux or macOS.
18-
steps:
19-
- uses: actions/checkout@v2
20-
21-
# we don't want to release commits that have been pushed and tagged, but not necessarily merged onto main
22-
- name: Ensure tagged commit is on main
23-
run: |
24-
echo "Tag: ${GITHUB_REF##*/}"
25-
git fetch origin main
26-
git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && echo "${GITHUB_REF##*/} is a commit on main!"
27-
28-
- name: Check static analysis results
29-
uses: fountainhead/action-wait-for-check@v1.0.0
30-
id: static-analysis
31-
with:
32-
token: ${{ secrets.GITHUB_TOKEN }}
33-
# This check name is defined as the github action job name (in .github/workflows/validations.yaml)
34-
checkName: "Static analysis"
35-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
36-
37-
- name: Check unit test results
38-
uses: fountainhead/action-wait-for-check@v1.0.0
39-
id: unit
40-
with:
41-
token: ${{ secrets.GITHUB_TOKEN }}
42-
# This check name is defined as the github action job name (in .github/workflows/validations.yaml)
43-
checkName: "Unit tests"
44-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
45-
46-
- name: Check acceptance test results (linux)
47-
uses: fountainhead/action-wait-for-check@v1.0.0
48-
id: acceptance-linux
49-
with:
50-
token: ${{ secrets.GITHUB_TOKEN }}
51-
# This check name is defined as the github action job name (in .github/workflows/validations.yaml)
52-
checkName: "Acceptance tests (Linux)"
53-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
54-
55-
- name: Check acceptance test results (mac)
56-
uses: fountainhead/action-wait-for-check@v1.0.0
57-
id: acceptance-mac
58-
with:
59-
token: ${{ secrets.GITHUB_TOKEN }}
60-
# This check name is defined as the github action job name (in .github/workflows/validations.yaml)
61-
checkName: "Acceptance tests (Mac)"
62-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
63-
64-
- name: Check cli test results (linux)
65-
uses: fountainhead/action-wait-for-check@v1.0.0
66-
id: cli-linux
67-
with:
68-
token: ${{ secrets.GITHUB_TOKEN }}
69-
# This check name is defined as the github action job name (in .github/workflows/testing.yaml)
70-
checkName: "CLI tests (Linux)"
71-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
72-
73-
- name: Quality gate
74-
if: steps.static-analysis.outputs.conclusion != 'success' || steps.unit.outputs.conclusion != 'success' || steps.acceptance-linux.outputs.conclusion != 'success' || steps.acceptance-mac.outputs.conclusion != 'success' || steps.cli-linux.outputs.conclusion != 'success'
75-
run: |
76-
echo "Static Analysis Status: ${{ steps.static-analysis.conclusion }}"
77-
echo "Unit Test Status: ${{ steps.unit.outputs.conclusion }}"
78-
echo "Acceptance Test (Linux) Status: ${{ steps.acceptance-linux.outputs.conclusion }}"
79-
echo "Acceptance Test (Mac) Status: ${{ steps.acceptance-mac.outputs.conclusion }}"
80-
echo "CLI Test (Linux) Status: ${{ steps.cli-linux.outputs.conclusion }}"
81-
false
82-
8319
release:
84-
needs: [quality-gate]
8520
runs-on: ubuntu-latest
8621
steps:
87-
88-
- uses: actions/setup-go@v2
89-
with:
90-
go-version: ${{ env.GO_VERSION }}
91-
92-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
9323
with:
9424
fetch-depth: 0
9525

96-
- name: Restore tool cache
97-
id: tool-cache
98-
uses: actions/cache@v2.1.3
99-
with:
100-
path: ${{ github.workspace }}/.tmp
101-
key: ${{ runner.os }}-tool-${{ hashFiles('Makefile') }}
102-
103-
- name: Restore go cache
104-
id: go-cache
105-
uses: actions/cache@v2.1.3
26+
- uses: actions/setup-go@v5
10627
with:
107-
path: ~/go/pkg/mod
108-
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
109-
restore-keys: |
110-
${{ runner.os }}-go-${{ env.GO_VERSION }}-
28+
go-version: ${{ env.GO_VERSION }}
11129

112-
- name: (cache-miss) Bootstrap all project dependencies
113-
if: steps.tool-cache.outputs.cache-hit != 'true' || steps.go-cache.outputs.cache-hit != 'true'
30+
- name: Bootstrap all project dependencies
11431
run: make bootstrap
11532

116-
- name: Build & publish release artifacts
117-
run: make release
33+
- name: Build
34+
run: |
35+
if [[ "${GITHUB_REF}" = refs/tags/v* ]]; then
36+
make release
37+
else
38+
make RELEASE_FLAGS="--snapshot" release
39+
fi
11840
env:
11941
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12042

121-
- uses: anchore/sbom-action@v0
122-
continue-on-error: true
123-
with:
124-
artifact-name: sbom.spdx.json
125-
126-
- uses: actions/upload-artifact@v2
43+
- uses: actions/upload-artifact@v4
12744
with:
12845
name: artifacts
12946
path: dist/**/*

.github/workflows/validations.yaml

Lines changed: 0 additions & 242 deletions
This file was deleted.

0 commit comments

Comments
 (0)