-
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (72 loc) · 2.62 KB
/
release.yml
File metadata and controls
80 lines (72 loc) · 2.62 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
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
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
deployments: write
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }}
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Set Node.js 18.x
uses: actions/setup-node@v6
with:
node-version: 18.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: Build SBOM with NPM
run: |
npm sbom --sbom-format spdx > microcks-microcks-postman-runtime-${{ github.event.inputs.version }}.spdx-sbom.json
- name: Publish release with JReleaser
uses: jreleaser/release-action@v2
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@v5
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 }}