-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: automate pr labeling and releases (#59)
- [x] update old release.yml to goreleaser.yml (fix some of its settings) - [x] update privateer-sdk to latest (v0.1.0) Signed-off-by: jmeridth <[email protected]>
- Loading branch information
Showing
7 changed files
with
152 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
name-template: "v$RESOLVED_VERSION" | ||
tag-template: "v$RESOLVED_VERSION" | ||
template: | | ||
# Changelog | ||
$CHANGES | ||
See details of [all code changes](https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release | ||
categories: | ||
- title: "🚀 Features" | ||
labels: | ||
- "feature" | ||
- "enhancement" | ||
- title: "🐛 Bug Fixes" | ||
labels: | ||
- "fix" | ||
- "bugfix" | ||
- "bug" | ||
- title: "🧰 Maintenance" | ||
labels: | ||
- "infrastructure" | ||
- "automation" | ||
- "documentation" | ||
- "dependencies" | ||
- "maintenance" | ||
- "revert" | ||
- title: "🏎 Performance" | ||
label: "performance" | ||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)" | ||
version-resolver: | ||
major: | ||
labels: | ||
- "breaking" | ||
minor: | ||
labels: | ||
- "enhancement" | ||
- "fix" | ||
patch: | ||
labels: | ||
- "documentation" | ||
- "maintenance" | ||
default: patch | ||
autolabeler: | ||
- label: "automation" | ||
title: | ||
- "/^(build|ci|perf|refactor|test).*/i" | ||
- label: "enhancement" | ||
title: | ||
- "/^(style).*/i" | ||
- label: "documentation" | ||
title: | ||
- "/^(docs).*/i" | ||
- label: "feature" | ||
title: | ||
- "/^(feat).*/i" | ||
- label: "fix" | ||
title: | ||
- "/^(fix).*/i" | ||
- label: "infrastructure" | ||
title: | ||
- "/^(infrastructure).*/i" | ||
- label: "maintenance" | ||
title: | ||
- "/^(chore|maintenance).*/i" | ||
- label: "revert" | ||
title: | ||
- "/^(revert).*/i" |
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,18 @@ | ||
--- | ||
name: "Auto Labeler" | ||
on: | ||
# pull_request_target event is required for autolabeler to support all PRs including forks | ||
pull_request_target: | ||
types: [opened, reopened, edited, synchronize] | ||
permissions: | ||
contents: read | ||
jobs: | ||
auto_labeler: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
uses: jmeridth/reusable-workflows/.github/workflows/auto-labeler.yaml@53a9c808122ffaae9af948f72139fb4bd44ab74c | ||
with: | ||
config-name: release-drafter.yml | ||
secrets: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
## After having trouble with the PUBLISHER_TOKEN, I started down this path... | ||
## But I never got the APP_ID to be accepted by the action | ||
## Error: [@octokit/auth-app] appId option must be a number or numeric string | ||
# - name: Generate token | ||
# id: generate_token | ||
# uses: tibdex/github-app-token@v1 | ||
# with: | ||
# app_id: ${{ secrets.APP_ID }} | ||
# private_key: ${{ secrets.APP_PEM }} | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23.4 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf | ||
with: | ||
distribution: goreleaser | ||
version: ${{ github.ref_name }} | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} |
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,38 +1,16 @@ | ||
## Reference: https://github.com/amannn/action-semantic-pull-request | ||
--- | ||
name: "Lint PR Title" | ||
|
||
on: | ||
# pull_request_target event is required for autolabeler to support all PRs including forks | ||
pull_request_target: | ||
types: [opened, reopened, edited, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
main: | ||
lint_pr_title: | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
statuses: write | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# Configure which types are allowed (newline-delimited). | ||
# From: https://github.com/commitizen/conventional-commit-types/blob/master/index.json | ||
# listing all below | ||
types: | | ||
build | ||
chore | ||
ci | ||
docs | ||
feat | ||
fix | ||
perf | ||
refactor | ||
revert | ||
style | ||
test | ||
uses: jmeridth/reusable-workflows/.github/workflows/pr-title.yaml@53a9c808122ffaae9af948f72139fb4bd44ab74c | ||
secrets: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,41 +1,18 @@ | ||
name: goreleaser | ||
|
||
--- | ||
name: "Release" | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
workflow_dispatch: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [main] | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
## After having trouble with the PUBLISHER_TOKEN, I started down this path... | ||
## But I never got the APP_ID to be accepted by the action | ||
## Error: [@octokit/auth-app] appId option must be a number or numeric string | ||
# - name: Generate token | ||
# id: generate_token | ||
# uses: tibdex/github-app-token@v1 | ||
# with: | ||
# app_id: ${{ secrets.APP_ID }} | ||
# private_key: ${{ secrets.APP_PEM }} | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.20.1 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf | ||
with: | ||
distribution: goreleaser | ||
version: ${{ env.GITHUB_REF_NAME }} | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} | ||
release: | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
uses: jmeridth/reusable-workflows/.github/workflows/release.yaml@53a9c808122ffaae9af948f72139fb4bd44ab74c | ||
with: | ||
publish: true | ||
release-config-name: release-drafter.yml | ||
secrets: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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