-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from initializ-buildpacks/automations/github-co…
…nfig/update Updates github-config
- Loading branch information
Showing
6 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish Draft Releases | ||
|
||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
- cron: '0 5 * * WED' # Weekly on Wednesday at 5:00 AM UTC | ||
|
||
concurrency: | ||
group: publish-release | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Publish Draft Release With Highest Semantic Version | ||
id: drafts | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
uses: initializ-buildpacks/github-config/actions/release/publish-drafts@main | ||
with: | ||
repo: ${{ github.repository }} | ||
|
||
failure: | ||
name: Alert on Failure | ||
runs-on: ubuntu-22.04 | ||
needs: [ publish ] | ||
if: ${{ always() && needs.publish.result == 'failure' }} | ||
steps: | ||
- name: File Failure Alert Issue | ||
uses: initializ-buildpacks/github-config/actions/issue/file@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
repo: ${{ github.repository }} | ||
label: "failure:release" | ||
comment_if_exists: true | ||
issue_title: "Failure: Publish draft releases" | ||
issue_body: | | ||
Publish All Draft Releases workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | ||
comment_body: | | ||
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Update Go version | ||
|
||
on: | ||
schedule: | ||
- cron: '48 4 * * MON' # every monday at 4:48 UTC | ||
workflow_dispatch: | ||
|
||
concurrency: update-go | ||
|
||
jobs: | ||
update-go: | ||
name: Update go toolchain in go.mod | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Checkout PR Branch | ||
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main | ||
with: | ||
branch: automation/go-mod-update/update-main | ||
- name: Setup Go | ||
id: setup-go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
- name: Get current go toolchain version | ||
id: current-go-version | ||
uses: initializ-buildpacks/github-config/actions/update-go-mod-version@main | ||
with: | ||
toolchain-version: ${{ steps.setup-go.outputs.go-version }} | ||
- name: Go mod tidy | ||
run: | | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
shopt -s inherit_errexit | ||
|
||
echo "Before running go mod tidy" | ||
echo "head -n10 go.mod " | ||
head -n10 go.mod | ||
|
||
echo "git diff" | ||
git diff | ||
|
||
echo "Running go mod tidy" | ||
go mod tidy | ||
|
||
echo "After running go mod tidy" | ||
echo "head -n10 go.mod " | ||
head -n10 go.mod | ||
|
||
echo "git diff" | ||
git diff | ||
- name: Commit | ||
id: commit | ||
uses: initializ-buildpacks/github-config/actions/pull-request/create-commit@main | ||
with: | ||
message: "Updates go mod toolchain version to ${{ steps.setup-go.outputs.go-version }}" | ||
pathspec: "." | ||
keyid: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY_ID }} | ||
key: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY }} | ||
|
||
- name: Push Branch | ||
if: ${{ steps.commit.outputs.commit_sha != '' }} | ||
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main | ||
with: | ||
branch: automation/go-mod-update/update-main | ||
|
||
- name: Open Pull Request | ||
if: ${{ steps.commit.outputs.commit_sha != '' }} | ||
uses: initializ-buildpacks/github-config/actions/pull-request/open@main | ||
with: | ||
token: ${{ secrets.PAT }} | ||
title: "Updates go mod toolchain version to ${{ steps.setup-go.outputs.go-version }}" | ||
branch: automation/go-mod-update/update-main | ||
|
||
failure: | ||
name: Alert on Failure | ||
runs-on: ubuntu-22.04 | ||
needs: [update-go] | ||
if: ${{ always() && needs.update-go.result == 'failure' }} | ||
steps: | ||
- name: File Failure Alert Issue | ||
uses: initializ-buildpacks/github-config/actions/issue/file@main | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
repo: ${{ github.repository }} | ||
label: "failure:update-go-version" | ||
comment_if_exists: true | ||
issue_title: "Failure: Update Go Mod Version workflow" | ||
issue_body: | | ||
Update Go Mod Version workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | ||
comment_body: | | ||
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"createpackage": "v1.69.1", | ||
"createpackage": "v1.70.0", | ||
"jam": "v2.7.2", | ||
"pack": "v0.33.2" | ||
} | ||
"pack": "v0.34.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters