Skip to content

Commit 4c6f096

Browse files
authored
.github/workflows: split release into pre-release-ci and release (manual) (cockroachdb#164)
Previously, we run the release workflow automatically whenever a v* tag gets pushed. The existing workflow does not work because the tests can be flaky. When that happens, there's no way to release a new TF version since goreleaser will only run once all the acceptance tests pass. Until the flakiness goes away, we will split the release workflow into two: pre-release-ci (that runs automatically like before), and release (which has to be triggered manually after all the acceptance tests are triaged).
1 parent ccb3d8f commit 4c6f096

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

.github/workflows/pre-release-ci.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: pre-release-ci
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
acceptance-test:
8+
name: acceptance-test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout sources
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{github.event.pull_request.head.ref}}
15+
repository: ${{github.event.pull_request.head.repo.full_name}}
16+
17+
- name: Setup Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.18
21+
22+
- name: Tests
23+
run: make testacc
24+
env:
25+
COCKROACH_API_KEY: ${{ secrets.COCKROACH_API_KEY }}

.github/workflows/release.yml

+6-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# This GitHub action can publish assets for release when a tag is created.
2-
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
2+
# Currently its setup to be triggered manually via the GitHUB UI. We should
3+
# only run this on a tag that matches the pattern "v*" (ie. v0.1.0) *after*
4+
# validating that the release can be signed off (e.g. by triaging the
5+
# pre-release-ci workflow).
36
#
47
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
58
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
@@ -8,38 +11,12 @@
811
#
912
# You will need to pass the `--batch` flag to `gpg` in your signing step
1013
# in `goreleaser` to indicate this is being used in a non-interactive mode.
11-
#
12-
name: release
13-
on:
14-
push:
15-
tags:
16-
- 'v*'
14+
name: release (manually, after pre-release-ci)
15+
on: workflow_dispatch
1716
permissions:
1817
contents: write
1918
jobs:
20-
# pre job to run acceptance tests
21-
acceptance-test:
22-
name: acceptance-test
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Checkout sources
26-
uses: actions/checkout@v2
27-
with:
28-
ref: ${{github.event.pull_request.head.ref}}
29-
repository: ${{github.event.pull_request.head.repo.full_name}}
30-
31-
- name: Setup Go
32-
uses: actions/setup-go@v2
33-
with:
34-
go-version: 1.18
35-
36-
- name: Tests
37-
run: make testacc
38-
env:
39-
COCKROACH_API_KEY: ${{ secrets.COCKROACH_API_KEY }}
40-
4119
goreleaser:
42-
needs: acceptance-test
4320
runs-on: ubuntu-latest
4421
steps:
4522
-

0 commit comments

Comments
 (0)