Skip to content

Commit ebe546d

Browse files
authored
Merge pull request #74 from IvanOfThings/fixing-actions
feat: fixing release process
2 parents c1dd044 + 973b485 commit ebe546d

File tree

3 files changed

+84
-81
lines changed

3 files changed

+84
-81
lines changed

.github/workflows/merge-content-to-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
- name: "Release with semantic-release"
2525
run: npx semantic-release --debug
2626
env:
27-
# GitHub sets this automatically
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
# Use PAT to allow triggering other workflows
28+
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,46 @@
11
# This GitHub action can publish assets for release when a tag is created.
22
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
33
#
4-
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
4+
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
55
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
66
# secret. If you would rather own your own GPG handling, please fork this action
77
# or use an alternative one for key handling.
88
#
9-
# You will need to pass the `--batch` flag to `gpg` in your signing step
9+
# You will need to pass the `--batch` flag to `gpg` in your signing step
1010
# in `goreleaser` to indicate this is being used in a non-interactive mode.
1111
#
1212
name: release
1313
on:
1414
workflow_dispatch:
1515
push:
1616
tags:
17-
- 'v*'
17+
- "v*"
1818
permissions:
1919
contents: write
2020
jobs:
2121
goreleaser:
2222
runs-on: ubuntu-latest
2323
steps:
24-
-
25-
name: Checkout
26-
uses: actions/checkout@v3
27-
-
28-
name: Unshallow
29-
run: git fetch --prune --unshallow
30-
-
31-
name: Set up Go
32-
uses: actions/setup-go@v3
24+
- name: Checkout
25+
uses: actions/checkout@v4
3326
with:
34-
go-version-file: 'go.mod'
27+
fetch-depth: 0
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version-file: "go.mod"
3532
cache: true
36-
-
37-
name: Import GPG key
38-
uses: crazy-max/ghaction-import-gpg@v5
33+
- name: Import GPG key
34+
uses: crazy-max/ghaction-import-gpg@v6
3935
id: import_gpg
4036
with:
4137
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
4238
passphrase: ${{ secrets.PASSPHRASE }}
43-
-
44-
name: Run GoReleaser
45-
uses: goreleaser/[email protected]
39+
- name: Run GoReleaser
40+
uses: goreleaser/goreleaser-action@v6
4641
with:
4742
version: latest
48-
args: release --rm-dist
43+
args: release --clean
4944
env:
5045
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
5146
# GitHub sets this automatically

.github/workflows/test.yml

Lines changed: 67 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ name: Tests
55
on:
66
pull_request:
77
paths-ignore:
8-
- 'README.md'
8+
- "README.md"
99
push:
1010
paths-ignore:
11-
- 'README.md'
11+
- "README.md"
1212
branches: [master]
13-
13+
1414
# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
15-
# we recommend testing at a regular interval not necessarily tied to code changes. This will
15+
# we recommend testing at a regular interval not necessarily tied to code changes. This will
1616
# ensure you are alerted to something breaking due to an API change, even if the code did not
1717
# change.
1818
# schedule:
@@ -24,32 +24,31 @@ jobs:
2424
runs-on: ubuntu-latest
2525
timeout-minutes: 5
2626
steps:
27+
- name: Check out code into the Go module directory
28+
uses: actions/checkout@v3
2729

28-
- name: Check out code into the Go module directory
29-
uses: actions/checkout@v3
30-
31-
- name: Set up Go
32-
uses: actions/setup-go@v3
33-
with:
34-
go-version-file: 'go.mod'
35-
cache: true
36-
id: go
30+
- name: Set up Go
31+
uses: actions/setup-go@v3
32+
with:
33+
go-version-file: "go.mod"
34+
cache: true
35+
id: go
3736

38-
- name: Get dependencies
39-
run: |
40-
go mod download
37+
- name: Get dependencies
38+
run: |
39+
go mod download
4140
42-
- name: Build
43-
run: |
44-
go build -v .
41+
- name: Build
42+
run: |
43+
go build -v .
4544
4645
generate:
4746
runs-on: ubuntu-latest
4847
steps:
4948
- uses: actions/checkout@v3
5049
- uses: actions/setup-go@v3
5150
with:
52-
go-version-file: 'go.mod'
51+
go-version-file: "go.mod"
5352
cache: true
5453
- name: Set up Terraform
5554
uses: hashicorp/setup-terraform@v2
@@ -70,7 +69,7 @@ jobs:
7069
test:
7170
name: Matrix Test
7271
needs: build
73-
runs-on: ubuntu-latest
72+
runs-on: ubuntu-latest
7473

7574
services:
7675
clickhouse:
@@ -88,54 +87,63 @@ jobs:
8887
--health-interval 15s
8988
--health-timeout 5s
9089
--health-retries 5
91-
90+
9291
timeout-minutes: 15
9392
strategy:
9493
fail-fast: false
9594
matrix:
9695
# list whatever Terraform versions here you would like to support
9796
terraform:
98-
- '0.12.*'
99-
- '0.13.*'
100-
- '0.14.*'
101-
- '0.15.*'
102-
- '1.0.*'
103-
- '1.1.*'
104-
- '1.2.*'
97+
- "0.12.*"
98+
- "0.13.*"
99+
- "0.14.*"
100+
- "0.15.*"
101+
- "1.0.*"
102+
- "1.1.*"
103+
- "1.2.*"
104+
- "1.3.*"
105+
- "1.4.*"
106+
- "1.5.*"
107+
- "1.6.*"
108+
- "1.8.*"
109+
- "1.9.*"
110+
- "1.10.*"
111+
- "1.11.*"
112+
- "1.12.*"
113+
- "1.13.*"
105114
steps:
115+
- name: Check out code into the Go module directory
116+
uses: actions/checkout@v3
106117

107-
- name: Check out code into the Go module directory
108-
uses: actions/checkout@v3
118+
- name: Set up Go
119+
uses: actions/setup-go@v3
120+
with:
121+
go-version-file: "go.mod"
122+
cache: true
123+
id: go
109124

110-
- name: Set up Go
111-
uses: actions/setup-go@v3
112-
with:
113-
go-version-file: 'go.mod'
114-
cache: true
115-
id: go
125+
- uses: hashicorp/setup-terraform@v2
126+
with:
127+
terraform_version: ${{ matrix.terraform }}
128+
terraform_wrapper: false
116129

117-
- uses: hashicorp/setup-terraform@v2
118-
with:
119-
terraform_version: ${{ matrix.terraform }}
120-
terraform_wrapper: false
130+
- name: Get dependencies
131+
run: |
132+
go mod download
121133
122-
- name: Get dependencies
123-
run: |
124-
go mod download
125-
126-
- name: TF acceptance tests
127-
timeout-minutes: 10
128-
env:
129-
TF_ACC: "1"
130-
TF_CLICKHOUSE_HOST: "127.0.0.1"
131-
TF_CLICKHOUSE_USERNAME: "default"
132-
TF_CLICKHOUSE_PASSWORD: ""
133-
TF_CLICKHOUSE_PORT: "9000"
134+
- name: TF acceptance tests
135+
timeout-minutes: 10
136+
env:
137+
TF_ACC: "1"
138+
TF_CLICKHOUSE_HOST: "127.0.0.1"
139+
TF_CLICKHOUSE_USERNAME: "default"
140+
TF_CLICKHOUSE_PASSWORD: ""
141+
TF_CLICKHOUSE_PORT: "9000"
134142

135-
# Set whatever additional acceptance test env vars here. You can
136-
# optionally use data from your repository secrets using the
137-
# following syntax:
138-
# SOME_VAR: ${{ secrets.SOME_VAR }}
143+
# Set whatever additional acceptance test env vars here. You can
144+
# optionally use data from your repository secrets using the
145+
# following syntax:
146+
# SOME_VAR: ${{ secrets.SOME_VAR }}
139147

140-
run: |
141-
go test -v -cover -tags testing ./...
148+
run: |
149+
go test -v -cover -tags testing ./...

0 commit comments

Comments
 (0)