-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.43 KB
/
Copy pathrelease.yml
File metadata and controls
49 lines (43 loc) · 1.43 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
name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g. 1.2.3)'
required: true
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: create release branch, update version and tag
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "release/v${{ github.event.inputs.version }}"
sed -i 's/^version = .*/version = "${{ github.event.inputs.version }}"/' build.gradle.kts
git add build.gradle.kts
git commit -m "release: ${{ github.event.inputs.version }}"
git tag "v${{ github.event.inputs.version }}"
git push origin "release/v${{ github.event.inputs.version }}" --tags
publish:
needs: prepare
uses: ./.github/workflows/publish.yml
secrets: inherit
with:
ref: v${{ github.event.inputs.version }}
github-release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: create GitHub release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "v${{ github.event.inputs.version }}" --generate-notes --title "v${{ github.event.inputs.version }}"