@@ -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
@@ -79,35 +73,40 @@ jobs:
79
73
outputs :
80
74
commit_hash : ${{ steps.empty-commit.outputs.commit_hash }}
81
75
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
76
+ - uses : actions/create-github-app-token@v1
77
+ id : app-token
78
+ with :
79
+ app-id : ${{ vars.RELEASE_CONTROLLER_APP_ID }}
80
+ private-key : ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
81
+ owner : ${{ github.repository_owner }}
82
+ repositories : " backup-utils,backup-utils-private"
83
+ - name : Get major-feature from version
84
+ id : get-major-feature
85
+ run : |
86
+ echo "MAJOR_FEATURE=$(echo ${{ github.event.inputs.version }} | cut -d '.' -f 1,2)" >> "$GITHUB_ENV"
87
+ - name : Verify major-feature
88
+ run : |
89
+ echo "major_feature: $MAJOR_FEATURE"
91
90
- name : Checkout backup-utils
92
91
uses : actions/checkout@v4
93
92
with :
94
- token : ${{ github.event.inputs.gh- token }}
93
+ token : ${{ steps.app-token.outputs. token }}
95
94
repository : github/backup-utils
96
- ref : master
97
95
- name : Create empty commit
98
96
uses : stefanzweifel/git-auto-commit-action@v4
99
97
id : empty-commit
100
98
with :
101
- branch : master
99
+ branch : ${{ env.MAJOR_FEATURE }}-stable
102
100
commit_message : " ${{ github.event.inputs.version }} release"
103
- commit_user_name : " ${{ github.actor }} "
104
- commit_user_email : " ghes-releases-team@ github.com"
101
+ commit_user_name : " release-controller[bot] "
102
+ commit_user_email : " 223695+release-controller[bot]@users.noreply. github.com"
105
103
commit_options : " --allow-empty"
104
+ push_options : " --force"
106
105
skip_dirty_check : true
107
- - name : Checkout backup-utils
106
+ - name : Checkout backup-utils-private for release notes
108
107
uses : actions/checkout@v4
109
108
with :
110
- token : ${{ github.event.inputs.gh- token }}
109
+ token : ${{ steps.app-token.outputs. token }}
111
110
repository : github/backup-utils-private
112
111
- name : Download deb artifact
113
112
uses : actions/download-artifact@v3
@@ -120,20 +119,17 @@ jobs:
120
119
- name : Create Release
121
120
uses : ncipollo/release-action@v1
122
121
with :
123
- token : ${{ github.event.inputs.gh-token }}
122
+ token : ${{ steps.app-token.outputs.token }}
123
+ owner : github
124
124
repo : backup-utils
125
125
name : |
126
126
GitHub Enterprise Server Backup Utilities v${{ github.event.inputs.version }}
127
127
artifacts : |
128
- github-backup-utils-v${{ github.event.inputs.version }}.tar.gz, \
128
+ github-backup-utils-v${{ github.event.inputs.version }}.tar.gz,
129
129
github-backup-utils_${{ github.event.inputs.version }}_all.deb
130
130
tag : v${{ github.event.inputs.version }}
131
- commit : ${{ steps.empty-commit.outputs.commit_hash }}
131
+ commit : ${{ env.MAJOR_FEATURE }}-stable
132
132
bodyFile : release-notes/${{ github.event.inputs.version }}.md
133
133
draft : ${{ github.event.inputs.draft }}
134
134
allowUpdates : true
135
- artifactContentType : " raw"
136
-
137
-
138
-
139
-
135
+ artifactContentType : " raw"
0 commit comments