Skip to content

Commit

Permalink
Merge branch 'master' into decode-block
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger authored Dec 4, 2024
2 parents 8825637 + 35640a5 commit ff14267
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/automate_releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

# Automate releases
26 changes: 26 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches: [master]

permissions:
contents: write
pull-requests: write

name: Create Release PR
jobs:
prepare-release:
if: "!contains(github.event.head_commit.message, 'chore: prepare release')" # Skip merges from releases
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --global user.name github-actions[bot]
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: knope-dev/action@407e9ef7c272d2dd53a4e71e39a7839e29933c48
- run: knope prepare-release --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
pull_request:
types:
- closed
branches:
- master

permissions:
contents: write

name: Create Release PR
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Configure Git
run: |
git config --global user.name github-actions[bot]
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: knope-dev/action@407e9ef7c272d2dd53a4e71e39a7839e29933c48
- run: knope release --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.sia.tech/coreutils
module go.sia.tech/coreutils // v0.7.0

go 1.23.1

Expand Down
54 changes: 54 additions & 0 deletions knope.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[package]
changelog = "CHANGELOG.md"
versioned_files = ["go.mod"]
ignore_go_major_versioning = true

[[workflows]]
name = "document-change"

[[workflows.steps]]
type = "CreateChangeFile"

[[workflows]]
name = "prepare-release"

[[workflows.steps]]
type = "Command"
command = "git switch -c release"

[[workflows.steps]]
type = "PrepareRelease"

[[workflows.steps]]
type = "Command"
command = "git commit -m \"chore: prepare release $version\""
variables = { "$version" = "Version" }

[[workflows.steps]]
type = "Command"
command = "git push --force --set-upstream origin release"

[workflows.steps.variables]
"$version" = "Version"

[[workflows.steps]]
type = "CreatePullRequest"
base = "master"

[workflows.steps.title]
template = "chore: prepare release $version"
variables = { "$version" = "Version" }

[workflows.steps.body]
template = "This PR was created automatically. Merging it will create a new release for $version\n\n$changelog"
variables = { "$changelog" = "ChangelogEntry", "$version" = "Version" }

[[workflows]]
name = "release"

[[workflows.steps]]
type = "Release"

[github]
owner = "SiaFoundation"
repo = "coreutils"

0 comments on commit ff14267

Please sign in to comment.