Repository navigation
148 lines (141 loc) · 4.61 KB
/
Copy pathtrunk.yml
File metadata and controls
148 lines (141 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Trunk checks, for a repository with one main branch, on which a release is a commit that changes the version, registered and tagged by TagBot.
# Called from the repository's own workflow, on pull requests into the main branch:
#
# on:
# pull_request:
# branches: [main]
# types: [opened, synchronize, reopened, labeled, unlabeled]
# jobs:
# trunk:
# uses: BioJulia/Workflows/.github/workflows/trunk.yml@v1
# permissions:
# contents: read
#
# A pull request that changes the version is a release: Release, Version, Changelog and Breaking changes.
# Any other: Release and Changelog entry, unless `require-entry` is false, for a changelog without an unreleased section.
# The checks that don't apply are skipped, and a skipped check counts as passed, so the ruleset may require every check, as "trunk / Version" and so on.
name: "Reusable: Trunk"
on:
workflow_call:
inputs:
main-branch:
description: The main branch.
type: string
default: main
skip-label:
description: The label that exempts a pull request from the changelog entry.
type: string
default: skip changelog
require-entry:
description: Whether a pull request that isn't a release must add a changelog entry.
type: boolean
default: true
check-links:
description: Whether to check the changelog's comparison links.
type: boolean
default: true
project:
description: The package's directory, relative to the repository's root, for a package in a subdirectory.
type: string
default: ''
registry:
description: The registry of the package's releases.
type: string
default: General
permissions: {}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
release: ${{ steps.release.outputs.release }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- id: release
uses: BioJulia/Workflows@v1.0.1
with:
check: is-release
model: trunk
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
version:
name: Version
needs: release
if: needs.release.outputs.release == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: version
model: trunk
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
registry: ${{ inputs.registry }}
changelog:
name: Changelog
needs: release
if: needs.release.outputs.release == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: changelog
model: trunk
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
check-links: ${{ inputs.check-links }}
registry: ${{ inputs.registry }}
breaking:
name: Breaking changes
needs: release
if: needs.release.outputs.release == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: julia-actions/setup-julia@da908477b5db94c10ffce8cfea9f2b3b9d5db687 # v3.0.3
with:
version: '1'
- uses: julia-actions/cache@9353db09a0f2bbbdec6f41791918c75d37391b36 # v3.5.0
- uses: BioJulia/Workflows@v1.0.1
with:
check: breaking
model: trunk
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
registry: ${{ inputs.registry }}
entry:
name: Changelog entry
needs: release
if: needs.release.outputs.release == 'false' && inputs.require-entry
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: BioJulia/Workflows@v1.0.1
with:
check: entry
model: trunk
project: ${{ inputs.project }}
main-branch: ${{ inputs.main-branch }}
skip-label: ${{ inputs.skip-label }}