Skip to content
This repository was archived by the owner on May 10, 2025. It is now read-only.

Commit 015c4e4

Browse files
style: Restructure (#37)
BREAKING CHANGE: This release has renamed ALL of the reusable workflows to be prefixed by `reusable-`
1 parent 203fe31 commit 015c4e4

19 files changed

+225
-148
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Git: Release SemVer"
3+
name: Git Release SemVer
44

55
on:
6-
workflow_call:
6+
workflow_dispatch:
77
inputs:
88
dry-run:
9-
type: boolean
10-
description: Dry Run
11-
default: false
9+
description: "Dry Run"
10+
default: true
1211
required: false
12+
type: boolean
1313

1414
push:
1515
branches: ["main"]
1616
paths:
17-
- ".github/workflows/*.yaml"
17+
- ".github/workflows/reusable-**"
18+
- ".renovate/*.json5"
19+
- ".releaserc.yaml"
20+
21+
pull_request:
22+
paths:
23+
- ".github/workflows/git-release-semver.yaml"
24+
- ".github/workflows/reusable-**"
1825

1926
jobs:
2027
release:
21-
runs-on: ubuntu-latest
22-
steps:
23-
- name: Generate Token
24-
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
25-
id: app-token
26-
with:
27-
app-id: "${{ secrets.BOT_APP_ID }}"
28-
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
29-
30-
- name: Checkout
31-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32-
with:
33-
token: "${{ steps.app-token.outputs.token }}"
34-
35-
- name: Run semantic-release
36-
uses: cycjimmy/semantic-release-action@v4
37-
with:
38-
dry_run: "${{ inputs.dry-run }}"
39-
env:
40-
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
28+
uses: ./.github/workflows/reusable-release-semver.yaml
29+
secrets: inherit
30+
with:
31+
dry-run: ${{ inputs.dry-run || github.event_name == 'pull_request' }}

.github/workflows/label-sync.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
name: Label Sync
4+
5+
on:
6+
# Manual trigger
7+
workflow_dispatch:
8+
inputs:
9+
dry-run:
10+
description: "Dry Run"
11+
default: true
12+
required: false
13+
type: boolean
14+
15+
# Dry run on pull requests
16+
pull_request:
17+
paths:
18+
- .github/workflows/label-sync.yaml
19+
- .github/labels/base.yaml
20+
21+
# Run when the configs changed on the main branch
22+
push:
23+
branches: ["main"]
24+
paths:
25+
- .github/workflows/label-sync.yaml
26+
- .github/labels/base.yaml
27+
28+
# Scheduled daily
29+
schedule:
30+
- cron: "0 0 * * *"
31+
32+
jobs:
33+
label-sync:
34+
uses: ./.github/workflows/reusable-label-sync.yaml
35+
secrets: inherit
36+
with:
37+
dry-run: ${{ inputs.dry-run || github.event_name == 'pull_request' }}
38+
config-file: .github/labels/base.yaml

.github/workflows/labeler.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
name: Labeler
4+
5+
on:
6+
# When a pull request is opened, reopened, or synchronized
7+
pull_request_target: {}
8+
9+
jobs:
10+
pr-labeler:
11+
uses: ./.github/workflows/reusable-labeler.yaml
12+
secrets: inherit
13+
with:
14+
config-file: .github/labeler/base.yaml

.github/workflows/renovate.yaml

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,38 @@
33
name: Renovate
44

55
on:
6-
# from other repositories
7-
workflow_call:
8-
inputs:
9-
config-file:
10-
description: Path to the renovate config file
11-
required: true
12-
type: string
13-
dry-run:
14-
type: boolean
15-
description: Dry Run
16-
default: false
17-
required: false
18-
log-level:
19-
type: string
20-
description: Log Level
21-
default: debug
22-
required: false
23-
24-
# from this repository
6+
# Manual trigger
257
workflow_dispatch:
268
inputs:
27-
config-file:
28-
description: Path to the renovate config file
29-
required: true
30-
type: string
319
dry-run:
3210
description: Dry Run
33-
default: false
11+
default: "false"
3412
required: false
35-
type: boolean
3613
log-level:
3714
description: Log Level
3815
default: debug
3916
required: false
40-
type: string
17+
18+
# Dry run on pull requests
19+
pull_request:
20+
paths:
21+
- ".github/workflows/renovate.yaml"
22+
- ".renovate/*.json5"
23+
- "renovate.json5"
24+
25+
# Scheduled hourly
4126
schedule:
42-
- cron: "0 * * * *" # hourly
27+
- cron: "0 * * * *"
4328

44-
env:
45-
LOG_LEVEL: "${{ inputs.log-level || 'debug' }}"
46-
RENOVATE_AUTODISCOVER: true
47-
RENOVATE_AUTODISCOVER_FILTER: "${{ github.repository }}"
48-
RENOVATE_DRY_RUN: "${{ inputs.dry-run == true }}"
49-
RENOVATE_PLATFORM: github
50-
RENOVATE_PLATFORM_COMMIT: true
51-
RENOVATE_VERSION: 37.367.0
52-
RENOVATE_GIT_AUTHOR: "mr-borboto[bot] <170036086+mr-borboto[bot]@users.noreply.github.com>"
53-
RENOVATE_CONFIG: "${{ inputs.config-gile || 'renovate.json5' }}"
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
31+
cancel-in-progress: true
5432

5533
jobs:
5634
renovate:
57-
runs-on: "ubuntu-latest"
58-
steps:
59-
- name: Generate Token
60-
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
61-
id: app-token
62-
with:
63-
app-id: "${{ secrets.BOT_APP_ID }}"
64-
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
65-
66-
- name: Checkout
67-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68-
with:
69-
token: "${{ steps.app-token.outputs.token }}"
70-
71-
- name: Renovate
72-
uses: renovatebot/github-action@dd4d265eb8646cd04fc5f86ff8bc8d496d75a251 # v40.2.8
73-
with:
74-
token: "${{ steps.app-token.outputs.token }}"
75-
configurationFile: "${{ env.RENOVATE_CONFIG }}"
76-
renovate-version: "${{ env.WORKFLOW_RENOVATE_VERSION }}"
35+
uses: ./.github/workflows/reusable-renovate.yaml
36+
secrets: inherit
37+
with:
38+
dry-run: "${{ inputs.dry-run == true || github.event_name == 'pull_request' }}"
39+
log-level: "${{ inputs.log-level || 'debug' }}"
40+
config-file: "renovate.json5"

.github/workflows/docker-release.yaml renamed to .github/workflows/reusable-docker-build-push.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Docker: Build and Push"
3+
name: Reusable - Docker Build Push
44

55
on:
66
workflow_call:
@@ -37,11 +37,15 @@ on:
3737
description: Whether or not to push the image.
3838
default: false
3939
required: false
40+
setup-qemu:
41+
type: boolean
42+
description: Whether or not to set up QEMU.
43+
default: true
44+
required: false
4045

4146
jobs:
4247
build-image:
4348
runs-on: ubuntu-latest
44-
4549
steps:
4650
- name: Generate Token
4751
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
@@ -56,6 +60,7 @@ jobs:
5660
token: "${{ steps.app-token.outputs.token }}"
5761

5862
- name: Set up QEMU
63+
if: ${{ inputs.setup-qemu == true }}
5964
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
6065

6166
- name: Set up Docker Buildx

.github/workflows/go-lint.yaml renamed to .github/workflows/reusable-go-lint.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Golang: Lint"
3+
name: Reusable - GolangCI Lint
44

55
on:
66
workflow_call:
77
inputs:
88
go-version:
99
type: string
1010
description: The Go version to use.
11-
required: true
11+
required: false
12+
default: "stable"
1213
golangci-version:
1314
type: string
1415
description: The version of golangci-lint to use.
1516
required: false
16-
default: "v1.60"
17+
default: "v1.60" #TODO add renovate annotation
1718
golangci-args:
1819
type: string
1920
description: Additional arguments to pass to golangci
@@ -41,7 +42,7 @@ jobs:
4142
with:
4243
go-version: "${{ inputs.go-version }}"
4344

44-
- name: Run lint
45+
- name: Run golangci-lint
4546
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
4647
with:
4748
version: "${{ inputs.golangci-version }}"

.github/workflows/go-release.yaml renamed to .github/workflows/reusable-go-release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Golang: Release"
3+
name: Reusable - Goreleaser
44

55
on:
66
workflow_call:
77
inputs:
88
go-version:
99
type: string
1010
description: The Go version to use.
11-
required: true
11+
required: false
12+
default: "stable"
1213
goreleaser-version:
1314
type: string
1415
description: The GoReleaser version to use.

.github/workflows/go-test.yaml renamed to .github/workflows/reusable-go-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Golang: Test"
3+
name: Reusable - Go Test
44

55
on:
66
workflow_call:
Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Meta: Label Sync"
3+
name: Reusable - Label Sync
44

55
on:
66
# from other repositories
@@ -16,30 +16,9 @@ on:
1616
description: Path to the labeler config file.
1717
default: ""
1818

19-
# from this repository
20-
workflow_dispatch:
21-
inputs:
22-
dry-run:
23-
type: boolean
24-
description: Dry Run
25-
default: false
26-
required: false
27-
config-file:
28-
type: string
29-
description: Path to the labeler config file.
30-
default: ""
31-
push:
32-
branches: ["main"]
33-
paths: ["labels/base.yaml"]
34-
pull_request:
35-
paths: ["labels/base.yaml"]
36-
schedule:
37-
- cron: "0 0 * * *" # Every day at midnight
38-
3919
jobs:
4020
label-sync:
4121
runs-on: ubuntu-latest
42-
4322
steps:
4423
- name: Generate Token
4524
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
@@ -57,9 +36,7 @@ jobs:
5736
- name: Sync Labels
5837
uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2.3.3
5938
with:
60-
dry-run: "${{ inputs.dry-run == true || github.event_name == 'pull_request' }}"
39+
dry-run: "${{ inputs.dry-run == true }}"
6140
token: "${{ steps.app-token.outputs.token }}"
6241
delete-other-labels: true
63-
config-file: |
64-
https://raw.githubusercontent.com/mirceanton/reusable-workflows/main/labels/base.yaml
65-
"${{ inputs.config-file }}"
42+
config-file: "${{ inputs.config-file }}"

.github/workflows/meta-labeler.yaml renamed to .github/workflows/reusable-labeler.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Meta: Labeler"
3+
name: Reusable - Labeler
44

55
on:
66
# from other repositories
@@ -11,10 +11,6 @@ on:
1111
description: Path to the labeler config file.
1212
default: ""
1313

14-
# from this repository
15-
pull_request_target:
16-
branches: ["main"]
17-
1814
jobs:
1915
size-label:
2016
runs-on: ubuntu-latest
@@ -51,6 +47,4 @@ jobs:
5147
with:
5248
sync-labels: true
5349
repo-token: "${{ steps.app-token.outputs.token }}"
54-
configuration-path: |
55-
https://raw.githubusercontent.com/mirceanton/reusable-workflows/main/labeler/base.yaml
56-
"${{ inputs.config-file }}"
50+
configuration-path: "${{ inputs.config-file }}"

.github/workflows/git-release-calver.yaml renamed to .github/workflows/reusable-release-calver.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3-
name: "Git: Release Calver"
3+
name: Reusable - Release Calver
44

55
on:
66
workflow_call:

0 commit comments

Comments
 (0)