-
-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (75 loc) · 2.92 KB
/
release.yml
File metadata and controls
85 lines (75 loc) · 2.92 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
name: release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release'
required: true
version:
description: 'Release version'
required: true
nextVersion:
description: 'Next version after release (-SNAPSHOT will be added automatically)'
required: true
permissions:
issues: write
contents: write
deployments: write
id-token: write # Required for OIDC and NPM Trusted Publisher support
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }}
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Set Node.js 20.x
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Set release version
run: |
npm install
npm version ${{ github.event.inputs.version }} --git-tag-version=false
- name: Commit, push and tag changes
run: |
git config user.name "microcks-bot"
git config user.email "info@microcks.io"
git commit -m "Releasing version ${{ github.event.inputs.version }}" .
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
- name: Publish package with NPM
run: |
npm sbom --sbom-format spdx > microcks-microcks-testcontainers-${{ github.event.inputs.version }}.spdx-sbom.json
npm run build
npm publish --provenance
npm pack
- name: Publish release with JReleaser
uses: jreleaser/release-action@90ac653bb9c79d11179e65d81499f3f34527dcd5 # v 2.5.0
env:
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Persist logs
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v 5.0.0
with:
name: jreleaser-release
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
- name: Set next iteration version
run: npm version ${{ github.event.inputs.nextVersion }}-SNAPSHOT --git-tag-version=false
- name: Commit, push and tag changes
run: |
git commit -m "Setting SNAPSHOT version ${{ github.event.inputs.nextVersion }}-SNAPSHOT" .
git push origin ${{ github.event.inputs.branch }}