Skip to content

Commit f97c67f

Browse files
Merge pull request #21 from initializ-buildpacks/automation/github-config/update
Updates github-config
2 parents b9ecf28 + b7553ce commit f97c67f

15 files changed

Lines changed: 236 additions & 87 deletions

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ updates:
1616
update-types:
1717
- "minor"
1818
- "patch"
19+
exclude-patterns:
20+
- "github.com/anchore/stereoscope"
21+
- "github.com/testcontainers/testcontainers-go"
22+
- "github.com/docker/docker"
23+
- "github.com/containerd/containerd"

.github/workflows/create-draft-release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ jobs:
5252
go-version: 'stable'
5353
- name: Checkout
5454
uses: actions/checkout@v3
55-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
5655
- name: Run Integration Tests
57-
run: ./scripts/integration.sh --use-token --builder ${{ matrix.builder }}
56+
run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }}
5857
env:
59-
GIT_TOKEN: ${{ github.token }}
6058
TMPDIR: "${{ runner.temp }}"
6159

6260
release:
@@ -70,7 +68,8 @@ jobs:
7068
go-version: 'stable'
7169
- name: Checkout
7270
uses: actions/checkout@v3
73-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
71+
with:
72+
fetch-tags: true
7473
- name: Reset Draft Release
7574
id: reset
7675
uses: initializ-buildpacks/github-config/actions/release/reset-draft@main

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Go
1717
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.20.x
19+
go-version: 'stable'
2020

2121
- name: Checkout
2222
uses: actions/checkout@v3
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish Draft Releases
2+
3+
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
- cron: '0 5 * * WED' # Weekly on Wednesday at 5:00 AM UTC
7+
8+
concurrency:
9+
group: publish-release
10+
11+
jobs:
12+
publish:
13+
name: Publish
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Publish Draft Release With Highest Semantic Version
17+
id: drafts
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.PAT }}
20+
uses: initializ-buildpacks/github-config/actions/release/publish-drafts@main
21+
with:
22+
repo: ${{ github.repository }}
23+
24+
failure:
25+
name: Alert on Failure
26+
runs-on: ubuntu-22.04
27+
needs: [ publish ]
28+
if: ${{ always() && needs.publish.result == 'failure' }}
29+
steps:
30+
- name: File Failure Alert Issue
31+
uses: initializ-buildpacks/github-config/actions/issue/file@main
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
repo: ${{ github.repository }}
35+
label: "failure:release"
36+
comment_if_exists: true
37+
issue_title: "Failure: Publish draft releases"
38+
issue_body: |
39+
Publish All Draft Releases workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
40+
comment_body: |
41+
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

.github/workflows/push-buildpackage.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types:
66
- published
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
push:
1014
name: Push
@@ -39,15 +43,6 @@ jobs:
3943
exit 1
4044
fi
4145
42-
- name: Push to GCR
43-
env:
44-
GCR_PUSH_BOT_JSON_KEY: ${{ secrets.GCR_PUSH_BOT_JSON_KEY }}
45-
run: |
46-
echo "${GCR_PUSH_BOT_JSON_KEY}" | sudo skopeo login --username _json_key --password-stdin gcr.io
47-
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_full }}"
48-
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_minor }}"
49-
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag_major }}"
50-
sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:latest"
5146
5247
- name: Push to DockerHub
5348
id: push

.github/workflows/test-pull-request.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ jobs:
5454
- name: Checkout
5555
uses: actions/checkout@v3
5656

57-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
58-
5957
- name: Run Integration Tests
60-
run: ./scripts/integration.sh --use-token --builder ${{ matrix.builder }}
58+
run: ./scripts/integration.sh --builder ${{ matrix.builder }} --token ${{ github.token }}
6159
env:
62-
GIT_TOKEN: ${{ github.token }}
6360
TMPDIR: "${{ runner.temp }}"
6461

6562
roundup:

.github/workflows/update-github-config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Checkout Branch
2828
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main
2929
with:
30-
branch: automation/github-config/update
30+
branch: automations/github-config/update
3131

3232
- name: Run the sync action
3333
uses: initializ-buildpacks/github-config/actions/sync@main
@@ -51,15 +51,15 @@ jobs:
5151
if: ${{ steps.commit.outputs.commit_sha != '' }}
5252
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main
5353
with:
54-
branch: automation/github-config/update
54+
branch: automations/github-config/update
5555

5656
- name: Open Pull Request
5757
if: ${{ steps.commit.outputs.commit_sha != '' }}
5858
uses: initializ-buildpacks/github-config/actions/pull-request/open@main
5959
with:
6060
token: ${{ secrets.PAT }}
6161
title: "Updates github-config"
62-
branch: automation/github-config/update
62+
branch: automations/github-config/update
6363

6464
failure:
6565
name: Alert on Failure
@@ -70,7 +70,7 @@ jobs:
7070
- name: File Failure Alert Issue
7171
uses: initializ-buildpacks/github-config/actions/issue/file@main
7272
with:
73-
token: ${{ secrets.PAT }}
73+
token: ${{ secrets.GITHUB_TOKEN }}
7474
repo: ${{ github.repository }}
7575
label: "failure:update-github-config"
7676
comment_if_exists: true
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Update Go version
2+
3+
on:
4+
schedule:
5+
- cron: '48 4 * * MON' # every monday at 4:48 UTC
6+
workflow_dispatch:
7+
8+
concurrency: update-go
9+
10+
jobs:
11+
update-go:
12+
name: Update go toolchain in go.mod
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
- name: Checkout PR Branch
18+
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main
19+
with:
20+
branch: automations/go-mod-update/update-main
21+
- name: Setup Go
22+
id: setup-go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: 'stable'
26+
- name: Get current go toolchain version
27+
id: current-go-version
28+
uses: initializ-buildpacks/github-config/actions/update-go-mod-version@main
29+
with:
30+
go-version: ${{ steps.setup-go.outputs.go-version }}
31+
- name: Go mod tidy
32+
run: |
33+
#!/usr/bin/env bash
34+
set -euo pipefail
35+
shopt -s inherit_errexit
36+
37+
echo "Before running go mod tidy"
38+
echo "head -n10 go.mod "
39+
head -n10 go.mod
40+
41+
echo "git diff"
42+
git diff
43+
44+
echo "Running go mod tidy"
45+
go mod tidy
46+
47+
echo "After running go mod tidy"
48+
echo "head -n10 go.mod "
49+
head -n10 go.mod
50+
51+
echo "git diff"
52+
git diff
53+
- name: Commit
54+
id: commit
55+
uses: initializ-buildpacks/github-config/actions/pull-request/create-commit@main
56+
with:
57+
message: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
58+
pathspec: "."
59+
keyid: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY_ID }}
60+
key: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY }}
61+
62+
- name: Push Branch
63+
if: ${{ steps.commit.outputs.commit_sha != '' }}
64+
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main
65+
with:
66+
branch: automations/go-mod-update/update-main
67+
68+
- name: Open Pull Request
69+
if: ${{ steps.commit.outputs.commit_sha != '' }}
70+
uses: initializ-buildpacks/github-config/actions/pull-request/open@main
71+
with:
72+
token: ${{ secrets.PAT }}
73+
title: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
74+
branch: automations/go-mod-update/update-main
75+
76+
failure:
77+
name: Alert on Failure
78+
runs-on: ubuntu-22.04
79+
needs: [update-go]
80+
if: ${{ always() && needs.update-go.result == 'failure' }}
81+
steps:
82+
- name: File Failure Alert Issue
83+
uses: initializ-buildpacks/github-config/actions/issue/file@main
84+
with:
85+
token: ${{ secrets.GITHUB_TOKEN }}
86+
repo: ${{ github.repository }}
87+
label: "failure:update-go-version"
88+
comment_if_exists: true
89+
issue_title: "Failure: Update Go Mod Version workflow"
90+
issue_body: |
91+
Update Go Mod Version workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
92+
comment_body: |
93+
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

scripts/.util/builders.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function util::builders::list() {
1919

2020
if [[ -z "${builders}" ]]; then
2121
util::print::info "No builders specified. Falling back to default builder..."
22-
builders="$(jq --compact-output --null-input '["index.docker.io/paketobuildpacks/builder-jammy-full:latest"]')"
22+
builders="$(jq --compact-output --null-input '["index.docker.io/initializbuildpacks/securepacks-initzbuilder:latest"]')"
2323
fi
2424

2525
echo "${builders}"

scripts/.util/git.sh

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

0 commit comments

Comments
 (0)