@@ -4,10 +4,6 @@ name: Build and Release
4
4
on :
5
5
workflow_dispatch :
6
6
inputs :
7
- gh-token :
8
- description : ' GitHub Token - used to create a commit in the backup-utils repo'
9
- required : true
10
- type : string
11
7
version :
12
8
description : ' Version - patch version of the release (e.g. x.y.z)'
13
9
required : true
21
17
jobs :
22
18
build :
23
19
runs-on : ubuntu-latest
20
+ outputs :
21
+ rc-app-token : ${{ steps.app-token.outputs.token }}
24
22
steps :
25
- # resulting token still gets denied by the backup-utils repo
26
- # see: https://github.com/actions/create-github-app-token/pull/46
27
- # - uses: timreimherr/create-github-app-token@main
28
- # id: app-token
29
- # with:
30
- # # required
31
- # app_id: ${{ vars.RELEASE_CONTROLLER_APP_ID }}
32
- # private_key: ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
33
- # owner: ${{ github.repository_owner }}
34
- # repositories: backup-utils,backup-utils-private
23
+ - uses : actions/create-github-app-token@v1
24
+ id : app-token
25
+ with :
26
+ app-id : ${{ vars.RELEASE_CONTROLLER_APP_ID }}
27
+ private-key : ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
28
+ owner : ${{ github.repository_owner }}
29
+ repositories : " backup-utils-private"
35
30
- name : Checkout backup-utils-private
36
31
uses : actions/checkout@v4
37
32
with :
38
- token : ${{ github.event.inputs.gh-token }}
39
- repository : github/backup-utils-private
33
+ token : ${{ steps.app-token.outputs.token }}
40
34
- name : Install dependencies
41
35
run : |
42
36
sudo apt-get update -y
50
44
- name : Package deb
51
45
run : |
52
46
./script/package-deb
53
- # many need to remove this once release-notes compilation is automated
54
- - name : Rename deb artifact
55
- run : |
56
- for file in dist/github-backup-utils_*_all.deb; do
57
- if [[ -f "$file" ]]; then
58
- mv "$file" "dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb"
59
- fi
60
- done
61
47
- name : Upload deb artifact
62
48
uses : actions/upload-artifact@v3
63
49
with :
@@ -79,35 +65,40 @@ jobs:
79
65
outputs :
80
66
commit_hash : ${{ steps.empty-commit.outputs.commit_hash }}
81
67
steps :
82
- # resulting token still gets denied by the backup-utils repo
83
- # see: https://github.com/actions/create-github-app-token/pull/46
84
- # - uses: timreimherr/create-github-app-token@main
85
- # id: app-token
86
- # with:
87
- # app_id: ${{ vars.RELEASE_CONTROLLER_APP_ID }}
88
- # private_key: ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
89
- # owner: ${{ github.repository_owner }}
90
- # repositories: backup-utils,backup-utils-private
68
+ - uses : actions/create-github-app-token@v1
69
+ id : app-token
70
+ with :
71
+ app-id : ${{ vars.RELEASE_CONTROLLER_APP_ID }}
72
+ private-key : ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
73
+ owner : ${{ github.repository_owner }}
74
+ repositories : " backup-utils,backup-utils-private"
75
+ - name : Get major-feature from version
76
+ id : get-major-feature
77
+ run : |
78
+ echo "MAJOR_FEATURE=$(echo ${{ github.event.inputs.version }} | cut -d '.' -f 1,2)" >> "$GITHUB_ENV"
79
+ - name : Verify major-feature
80
+ run : |
81
+ echo "major_feature: $MAJOR_FEATURE"
91
82
- name : Checkout backup-utils
92
83
uses : actions/checkout@v4
93
84
with :
94
- token : ${{ github.event.inputs.gh- token }}
85
+ token : ${{ steps.app-token.outputs. token }}
95
86
repository : github/backup-utils
96
- ref : master
97
87
- name : Create empty commit
98
88
uses : stefanzweifel/git-auto-commit-action@v4
99
89
id : empty-commit
100
90
with :
101
- branch : master
91
+ branch : ${{ env.MAJOR_FEATURE }}-stable
102
92
commit_message : " ${{ github.event.inputs.version }} release"
103
- commit_user_name : " ${{ github.actor }} "
104
- commit_user_email : " ghes-releases-team@ github.com"
93
+ commit_user_name : " release-controller[bot] "
94
+ commit_user_email : " 223695+release-controller[bot]@users.noreply. github.com"
105
95
commit_options : " --allow-empty"
96
+ push_options : " --force"
106
97
skip_dirty_check : true
107
- - name : Checkout backup-utils
98
+ - name : Checkout backup-utils-private for release notes
108
99
uses : actions/checkout@v4
109
100
with :
110
- token : ${{ github.event.inputs.gh- token }}
101
+ token : ${{ steps.app-token.outputs. token }}
111
102
repository : github/backup-utils-private
112
103
- name : Download deb artifact
113
104
uses : actions/download-artifact@v3
@@ -120,20 +111,17 @@ jobs:
120
111
- name : Create Release
121
112
uses : ncipollo/release-action@v1
122
113
with :
123
- token : ${{ github.event.inputs.gh-token }}
114
+ token : ${{ steps.app-token.outputs.token }}
115
+ owner : github
124
116
repo : backup-utils
125
117
name : |
126
118
GitHub Enterprise Server Backup Utilities v${{ github.event.inputs.version }}
127
119
artifacts : |
128
- github-backup-utils-v${{ github.event.inputs.version }}.tar.gz, \
120
+ github-backup-utils-v${{ github.event.inputs.version }}.tar.gz,
129
121
github-backup-utils_${{ github.event.inputs.version }}_all.deb
130
122
tag : v${{ github.event.inputs.version }}
131
- commit : ${{ steps.empty-commit.outputs.commit_hash }}
123
+ commit : ${{ env.MAJOR_FEATURE }}-stable
132
124
bodyFile : release-notes/${{ github.event.inputs.version }}.md
133
125
draft : ${{ github.event.inputs.draft }}
134
126
allowUpdates : true
135
- artifactContentType : " raw"
136
-
137
-
138
-
139
-
127
+ artifactContentType : " raw"
0 commit comments