-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (102 loc) · 2.94 KB
/
release.yml
File metadata and controls
109 lines (102 loc) · 2.94 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch'
default: main
required: true
version:
description: 'Version'
required: true
env:
GITHUB_TOKEN: ${{ secrets.userToken }}
branch: ${{ github.event.inputs.branch }}
version: ${{ github.event.inputs.version }}
configPath: .github/config.yml
packagePath: package.json
date: ''
jobs:
main:
name: Main
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.userToken }}
ref: ${{ env.branch }}
- name: Setup
run: |
date=$(date --iso-8601=seconds)
echo "date=$date" >> $GITHUB_ENV
- name: Config
uses: unity-game-framework-actions/file-access@main
id: config
with:
input: |
get:
changelog:
input: ${{ env.configPath }}
path: changelog
readme:
input: ${{ env.configPath }}
path: readme
notes:
input: ${{ env.configPath }}
path: notes
- name: Package
uses: unity-game-framework-actions/file-access@main
id: package
with:
input: |
set:
version:
input: ${{ env.packagePath }}
path: version
value: ${{ env.version }}
- name: Milestone
uses: unity-game-framework-actions/milestone-release@main
with:
release: ${{ env.version }}
- name: Readme
uses: unity-game-framework-actions/package-readme@main
with:
input: ${{ env.packagePath }}
config: ${{ steps.config.outputs.readme }}
output: readme.md
- name: Notes
uses: unity-game-framework-actions/milestone-changelog@main
id: notes
with:
milestone: ${{ env.version }}
config: ${{ steps.config.outputs.notes }}
output: notes.md
- name: Changelog
uses: unity-game-framework-actions/releases-changelog@main
with:
branch: ${{ env.branch }}
config: ${{ steps.config.outputs.changelog }}
input: |
releases:
- tag_name: ${{ env.version }}
html_url: https://github.com/${{ github.repository }}/releases/tag/${{ env.version }}
published_at: '${{ env.date }}'
body: notes.md
output: changelog.md
- name: Push
run: |
git config user.name ${{ secrets.userName }}
git config user.email ${{ secrets.userEmail }}
git add ${{ env.packagePath }}
git add changelog.md
git add readme.md
git commit -m "Setup release ${{ env.version }}"
git push
- name: Create
run: |
prerelease=""
if [ "${{ contains(env.version, '-preview') }}" = "true" ]; then
prerelease="-p"
fi
gh release create ${{ env.version }} -t ${{ env.version }} -F notes.md $prerelease