Skip to content

Commit 570e593

Browse files
authored
Merge pull request #174 from infrablocks/gha-migration
Migrate pipeline from CircleCI to GitHub Actions
2 parents 3c72f36 + eb625b0 commit 570e593

27 files changed

Lines changed: 407 additions & 437 deletions

.circleci/config.yml

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

.github/workflows/main.yaml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Main
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install tools
17+
uses: infrablocks/github-actions/asdf_install@v1
18+
- name: Check
19+
run: ./go library:check
20+
- name: Notify Slack
21+
if: ${{ !cancelled() }}
22+
continue-on-error: true
23+
run: ./go "slack:notify[${{ job.status }}]"
24+
env:
25+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
26+
27+
test:
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 15
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Install tools
33+
uses: infrablocks/github-actions/asdf_install@v1
34+
- name: Install libsodium
35+
run: ./scripts/ci/common/install-libsodium.sh
36+
- name: Test
37+
run: ./go test:unit
38+
- name: Notify Slack
39+
if: ${{ !cancelled() }}
40+
continue-on-error: true
41+
run: ./go "slack:notify[${{ job.status }}]"
42+
env:
43+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
44+
45+
prerelease:
46+
needs: [check, test]
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 30
49+
# Job-level group (here and on release): a run awaiting release approval
50+
# holds the slot, and a workflow-level group would freeze all main CI for
51+
# the approval window. queue: max keeps every queued run; the default
52+
# cancels all but the newest.
53+
concurrency:
54+
group: main
55+
cancel-in-progress: false
56+
queue: max
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Install tools
62+
uses: infrablocks/github-actions/asdf_install@v1
63+
- name: Install secrets tools
64+
run: ./scripts/ci/common/install-git-crypt.sh
65+
- name: Unlock git-crypt
66+
run: ./go git_crypt:unlock_with_encrypted_gpg_key
67+
env:
68+
ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }}
69+
- name: Configure RubyGems credentials
70+
run: ./scripts/ci/common/configure-rubygems.sh
71+
- name: Set CI git author
72+
run: ./go repository:set_ci_author
73+
- name: Bump version
74+
run: ./go "version:bump[pre]"
75+
- name: Release
76+
run: ./go release
77+
- name: Push commits
78+
run: git push
79+
- name: Push tags
80+
run: git push --tags
81+
- name: Notify Slack of release hold
82+
continue-on-error: true
83+
run: ./go "slack:notify[success,on_hold]"
84+
env:
85+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
86+
- name: Notify Slack
87+
if: ${{ !cancelled() }}
88+
continue-on-error: true
89+
run: ./go "slack:notify[${{ job.status }}]"
90+
env:
91+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
92+
93+
release:
94+
needs: [prerelease]
95+
runs-on: ubuntu-latest
96+
timeout-minutes: 30
97+
environment: release
98+
concurrency:
99+
group: main
100+
cancel-in-progress: false
101+
queue: max
102+
permissions:
103+
contents: write
104+
steps:
105+
- uses: actions/checkout@v4
106+
with:
107+
ref: main
108+
- name: Pull latest main
109+
# Publishes main as of approval time, not the SHA that triggered the
110+
# run; --ff-only so a non-fast-forward fails loudly
111+
run: git pull --ff-only
112+
- name: Install tools
113+
uses: infrablocks/github-actions/asdf_install@v1
114+
- name: Install secrets tools
115+
run: ./scripts/ci/common/install-git-crypt.sh
116+
- name: Unlock git-crypt
117+
run: ./go git_crypt:unlock_with_encrypted_gpg_key
118+
env:
119+
ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }}
120+
- name: Configure RubyGems credentials
121+
run: ./scripts/ci/common/configure-rubygems.sh
122+
- name: Set CI git author
123+
run: ./go repository:set_ci_author
124+
- name: Bump version
125+
run: ./go "version:bump[minor]"
126+
- name: Release
127+
run: ./go release
128+
- name: Push commits
129+
run: git push
130+
- name: Push tags
131+
run: git push --tags
132+
- name: Notify Slack
133+
if: ${{ !cancelled() }}
134+
continue-on-error: true
135+
run: ./go "slack:notify[${{ job.status }}]"
136+
env:
137+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 commit comments

Comments
 (0)