-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (45 loc) · 1.4 KB
/
prepare-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
on:
workflow_call:
inputs:
working-dir:
required: true
type: string
outputs:
release-version:
value: ${{ jobs.prepare-release.outputs.version }}
release-notes:
value: ${{ jobs.prepare-release.outputs.notes }}
jobs:
prepare-release:
name: 🛫 Prepare release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prepare-release.outputs.version }}
notes: ${{ steps.prepare-release.outputs.notes }}
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🏗 Setup node env
uses: actions/setup-node@v4
with:
node-version: lts/*
cache-dependency-path: package-lock.json
- name: 👨🏻💻 Install dependencies
run: npm install
- name: 🛫 Prepare Release
id: prepare-release
working-directory: ${{ inputs.working-dir }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p release
echo 'dev' > release/version.txt
touch release/notes.md
npx semantic-release-plus
version=$(cat release/version.txt)
notes=$(cat release/notes.md)
notes="${notes//'%'/'%25'}"
notes="${notes//$'\n'/'%0A'}"
notes="${notes//$'\r'/'%0D'}"
echo "::set-output name=version::$version"
echo "::set-output name=notes::$notes"