-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.95 KB
/
release:create.yaml
File metadata and controls
67 lines (58 loc) · 1.95 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
name: 🚀 Create Release PR
run-name: "Create Release PR: ${{ inputs.package }} ${{ inputs.semver }}"
on:
workflow_dispatch:
inputs:
package:
type: choice
description: The package to release
options:
- core
- dart-indexer
- typescript-indexer
semver:
type: choice
description: The semver that this change is
options:
- major
- minor
- patch
permissions:
contents: write
pull-requests: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- id: analyze
run: |
if [[ '${{ inputs.package }}' == 'core' ]]; then
path='./'
file='package.json'
elif [[ '${{ inputs.package }}' == 'dart-indexer' ]]; then
path='./indexers/dart'
file='pubspec.yaml'
elif [[ '${{ inputs.package }}' == 'typescript-indexer' ]]; then
path='./indexers/typescript'
file='package.json'
fi
echo "path=$path" >> $GITHUB_OUTPUT
echo "file=$file" >> $GITHUB_OUTPUT
- name: Update Version
working-directory: ${{ steps.analyze.outputs.path }}
id: update-version
run: |
CURRENT=$(yq -r '.version' ${{ steps.analyze.outputs.file }})
export NEXT=$(npx semver "$CURRENT" -i "${{ inputs.semver }}")
yq '.version = env(NEXT)' ${{ steps.analyze.outputs.file }}
echo "next-version=$NEXT" >> $GITHUB_OUTPUT
- name: Update Changelog Header
working-directory: ${{ steps.analyze.outputs.path }}
env:
version: ${{ steps.update-version.outputs.next-version }}
run: |
sed -i "s/## Unreleased/## Unreleased\n\n\n## $version/" CHANGELOG.md
- uses: peter-evans/create-pull-request@v8
with:
branch: release/${{ inputs.package }}/${{ steps.update-version.outputs.next-version }}