-
-
Notifications
You must be signed in to change notification settings - Fork 199
73 lines (72 loc) · 2.77 KB
/
release-private-start.yml
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
name: Private - Create Release Branch
on:
workflow_dispatch:
inputs:
bumpType:
description: "Bump type to use for the release branch."
type: choice
default: patch
options:
- patch
- minor
- major
required: true
jobs:
release_private:
if: ${{ github.repository == 'BC-Security/Starkiller-Sponsors' }}
runs-on: ubuntu-latest
steps:
- name: Set target branch
run: echo "TARGET_BRANCH=private-main" >> $GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ env.TARGET_BRANCH }}
submodules: "recursive"
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
- uses: actions/setup-node@v4
with:
node-version: 16
- name: Change version number
run: |
npm -no-git-tag-version version ${{ github.event.inputs.bumpType }}
# duplicate line?
APP_VERSION=$(npm pkg get version | sed 's/"//g')
echo "APP_VERSION=$(npm pkg get version | sed 's/"//g')" >> $GITHUB_ENV
- name: Get release branch name
run: |
echo "RELEASE_BRANCH=release/$APP_VERSION-private" >> $GITHUB_ENV
- name: Create release branch
run: git checkout -b ${{ env.RELEASE_BRANCH }}
- name: Update Changelog
uses: vinnybod/[email protected]
with:
tag: v${{ env.APP_VERSION }}
skipDiff: false
- name: Commit changelog and manifest files
id: make-commit
run: |
git add -A
git commit --message "Prepare release ${{ env.APP_VERSION }} private"
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Push new branch
run: git push origin ${{ env.RELEASE_BRANCH }}
- name: Create pull request into ${{ env.TARGET_BRANCH }}
uses: thomaseizinger/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
head: ${{ env.RELEASE_BRANCH }}
base: ${{ env.TARGET_BRANCH }}
title: v${{ env.APP_VERSION }} into ${{ env.TARGET_BRANCH }}
reviewers: ${{ github.event.issue.user.login }}
body: |
This PR was automatically generated by the `release-private-start` workflow.
I've updated the version name and code commit: ${{ steps.make-commit.outputs.commit }}.
This PR should be merged with a merge commit, **not a squash commit.**
Merging this PR will trigger a tag and release automatically.
It will create a tag for `v${{ env.APP_VERSION }}-private`.