-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (140 loc) · 4.53 KB
/
merge-main.yml
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
149
150
151
152
153
154
155
name: Merge to Main
on:
push:
branches:
- main
paths-ignore:
- ".github/ISSUE_TEMPLATE/*"
- "**.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
semver: ${{ steps.semver.outputs.version }}
tag: ${{ steps.semver.outputs.tag }}
clean_changelog: ${{ steps.semver.outputs.clean_changelog }}
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
# Get PR number for squash merges to main
- name: PR Number
id: pr
uses: bcgov-nr/action-get-pr@v0.0.1
- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v5.3.0
id: semver
with:
git-branch: refs/heads/${{ github.head_ref }}
git-push: 'false'
skip-commit: 'true'
skip-on-empty: 'false'
skip-version-file: 'true'
certextractor:
name: Promote certextractor
needs: [vars]
runs-on: ubuntu-24.04
steps:
- uses: shrink/actions-docker-registry-tag@v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/certextractor
target: ${{ needs.vars.outputs.semver }}.PR${{ needs.vars.outputs.pr}}
tags: ${{ needs.vars.outputs.semver }}
release-core:
name: Build Core
runs-on: ubuntu-24.04
needs: [vars]
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Removing old core
uses: paulushcgcj/delete-github-package@1.0.0
continue-on-error: true
with:
token: ${{ secrets.PAT }}
type: maven
name: ca.bc.gov.nrs-commons.forest-client-core
version: ${{ needs.vars.outputs.semver }}
user: ${{ github.repository_owner }}
- name: Publish Core
uses: paulushcgcj/action-java-publish@v0.1.1
with:
dir: core
app-version: ${{ needs.vars.outputs.semver }}
extra-params: -DskipTests -Dtests.skip=true
add-sources: true
add-javadoc: true
env:
GITHUB_TOKEN: ${{ github.token }}
release-spring:
name: Build Spring
runs-on: ubuntu-24.04
needs: [vars, release-core]
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Removing old spring
uses: paulushcgcj/delete-github-package@1.0.0
continue-on-error: true
with:
token: ${{ secrets.PAT }}
type: maven
name: ca.bc.gov.nrs-commons.forest-client-spring
version: ${{ needs.vars.outputs.semver }}
user: ${{ github.repository_owner }}
- name: Publish Spring
uses: paulushcgcj/action-java-publish@v0.1.1
with:
dir: spring
app-version: ${{ needs.vars.outputs.semver }}
extra-params: -DskipTests -Dtests.skip=true -Dcore.version=${{ needs.vars.outputs.semver }}
add-sources: true
add-javadoc: true
env:
GITHUB_TOKEN: ${{ github.token }}
tagging:
name: Tagging library
needs: [vars,certextractor,release-core,release-spring]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "github"
- name: Create Release
uses: softprops/action-gh-release@v2
if: ${{ needs.vars.outputs.tag != '' }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ github.token }}
tag_name: ${{ needs.vars.outputs.tag }}
name: ${{ needs.vars.outputs.tag }}
body: |
${{ needs.vars.outputs.clean_changelog }}
```
<dependency>
<groupId>ca.bc.gov.nrs-commons</groupId>
<artifactId>forest-client-core</artifactId>
<version>${{ needs.vars.outputs.semver }}</version>
</dependency>
```
```
<dependency>
<groupId>ca.bc.gov.nrs-commons</groupId>
<artifactId>forest-client-spring</artifactId>
<version>${{ needs.vars.outputs.semver }}</version>
</dependency>
```