This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (91 loc) · 2.8 KB
/
create_release.yaml
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
name: Create Release
on:
workflow_call:
secrets:
cargo_token:
required: true
outputs:
version:
description: "New version"
value: ${{ jobs.release.outputs.version }}
permissions:
contents: write
issues: write
env:
NODE_VERSION: '20.x'
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.nextVersion.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: json-schema
path: artifacts
# - uses: actions/download-artifact@v3
# with:
# name: rust-schema
# path: artifacts
- uses: actions/download-artifact@v4
with:
name: pydantic-schema
path: packages/python/src/epdx
- uses: actions/download-artifact@v4
with:
name: javascript-files
path: artifacts
# - uses: actions/download-artifact@v3
# with:
# name: csharp-schema
# path: artifacts
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Semantic-Release
run: |
npm install \
semantic-release \
@semantic-release/changelog \
@semantic-release/git \
@semantic-release/github \
semantic-release-cargo \
conventional-changelog-conventionalcommits
- name: Set next version
id: nextVersion
run: |
export NEXT_VERSION=$(npx semantic-release --dry-run | grep -i 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Echo next version
run: echo "${{ steps.nextVersion.outputs.version }}"
- name: Run Semantic-Release
if: github.event_name != 'pull_request'
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Run Semantic-Release Dry Run
if: github.event_name == 'pull_request'
run: npx semantic-release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Upload Cargo
if: steps.nextVersion.outputs.version != ''
uses: actions/upload-artifact@v4
with:
name: cargo
path: 'Cargo*'
- name: Upload CHANGELOG
uses: actions/upload-artifact@v4
with:
name: changelog
path: 'CHANGELOG.md'