This repository was archived by the owner on Oct 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (70 loc) · 2.86 KB
/
Copy pathdraft-new-release.yaml
File metadata and controls
87 lines (70 loc) · 2.86 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
81
82
83
84
85
86
87
name: 'Draft New Release'
on:
repository_dispatch:
types: [draft-new-release]
workflow_dispatch:
inputs:
version:
description: 'The release version'
required: true
jobs:
draft_new_release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
actions: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup yq
uses: dcarbone/install-yq-action@v1.3.1
with:
version: 'v4.42.1'
force: true
- name: Initialize mandatory git config
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
- name: Determine release version
id: set-version
run: |
echo "RELEASE_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV
- name: Create release branch
run: git checkout -b release/${{ env.RELEASE_VERSION }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
with:
tag: ${{ env.RELEASE_VERSION }}
- name: Bump version in package.json
run: yq -i '.version="${{ env.RELEASE_VERSION }}"' packages.json
- name: Bump version in app/package.json
working-directory: app
run: yq -i '.version="${{ env.RELEASE_VERSION }}"' packages.json
- name: Bump version in CITATION.cff
run: |
yq -i '.version="${{ env.RELEASE_VERSION }}"' CITATION.cff
- name: Commit changes
id: make-commit
run: |
git add CHANGELOG.md CITATION.cff package.json app/package.json
git commit --message "ci: prepare release ${{ env.RELEASE_VERSION }}"
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Push new branch
run: git push origin release/${{ env.RELEASE_VERSION }}
- name: Create pull request
uses: thomaseizinger/create-pull-request@1.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: release/${{ env.RELEASE_VERSION }}
base: main
title: Release version ${{ env.RELEASE_VERSION }}
reviewers: ${{ github.actor }}
body: |
Hi @${{ github.actor }}! 👋
This PR was created in response to a trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
**NOTE:** Please make sure to merge the [backend](https://github.com/green-ecolution/backend) release first!