8
8
description : ' Version - patch version of the release (e.g. x.y.z)'
9
9
required : true
10
10
type : string
11
- branch_ref_or_commit :
12
- description : ' Branch ref or commit - the backup-utils release will associated with the branch ref or commit provided. If blank, an empty commit will be created on master '
13
- required : false
11
+ release_commit_branch :
12
+ description : ' Release Commit Branch - the branch on which the release commit will be made. '
13
+ required : true
14
14
type : string
15
15
draft :
16
16
description : ' Draft - true if the release should be a draft'
19
19
default : true
20
20
21
21
jobs :
22
- # build:
23
- # runs-on: ubuntu-latest
24
- # outputs:
25
- # rc-app-token: ${{ steps.app-token.outputs.token }}
26
- # steps:
27
- # - uses: actions/create-github-app-token@v1
28
- # id: app-token
29
- # with:
30
- # app-id: ${{ vars.RELEASE_CONTROLLER_APP_ID }}
31
- # private-key: ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
32
- # owner: ${{ github.repository_owner }}
33
- # repositories: "backup-utils-private"
34
- # - name: Checkout backup-utils-private
35
- # uses: actions/checkout@v4
36
- # with:
37
- # token: ${{ steps.app-token.outputs.token }}
38
- # - name: Install dependencies
39
- # run: |
40
- # sudo apt-get update -y
41
- # sudo apt-get install -y moreutils debhelper help2man devscripts gzip
42
- # - name: Create tag # this is required for the build scripts
43
- # run: |
44
- # git config user.name "${{ github.actor }}"
45
- # git config user.email "[email protected] "
46
- # git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}"
47
- # git push origin "v${{ github.event.inputs.version }}"
48
- # - name: Package deb
49
- # run: |
50
- # ./script/package-deb
51
- # # many need to remove this once release-notes compilation is automated
52
- # - name: Rename deb artifact
53
- # run: |
54
- # for file in dist/github-backup-utils_*_all.deb; do
55
- # if [[ -f "$file" ]]; then
56
- # mv "$file" "dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb"
57
- # fi
58
- # done
59
- # - name: Upload deb artifact
60
- # uses: actions/upload-artifact@v3
61
- # with:
62
- # name: github-backup-utils_${{ github.event.inputs.version }}_all.deb
63
- # path: |
64
- # dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb
65
- # - name: Package tarball
66
- # run: |
67
- # ./script/package-tarball
68
- # - name: Upload tarball artifact
69
- # uses: actions/upload-artifact@v3
70
- # with:
71
- # name: github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
72
- # path: |
73
- # dist/github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
22
+ build :
23
+ runs-on : ubuntu-latest
24
+ outputs :
25
+ rc-app-token : ${{ steps.app-token.outputs.token }}
26
+ steps :
27
+ - uses : actions/create-github-app-token@v1
28
+ id : app-token
29
+ with :
30
+ app-id : ${{ vars.RELEASE_CONTROLLER_APP_ID }}
31
+ private-key : ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
32
+ owner : ${{ github.repository_owner }}
33
+ repositories : " backup-utils-private"
34
+ - name : Checkout backup-utils-private
35
+ uses : actions/checkout@v4
36
+ with :
37
+ token : ${{ steps.app-token.outputs.token }}
38
+ - name : Install dependencies
39
+ run : |
40
+ sudo apt-get update -y
41
+ sudo apt-get install -y moreutils debhelper help2man devscripts gzip
42
+ - name : Create tag # this is required for the build scripts
43
+ run : |
44
+ git config user.name "${{ github.actor }}"
45
+ git config user.email "[email protected] "
46
+ git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}"
47
+ git push origin "v${{ github.event.inputs.version }}"
48
+ - name : Package deb
49
+ run : |
50
+ ./script/package-deb
51
+ # many need to remove this once release-notes compilation is automated
52
+ - name : Rename deb artifact
53
+ run : |
54
+ for file in dist/github-backup-utils_*_all.deb; do
55
+ if [[ -f "$file" ]]; then
56
+ mv "$file" "dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb"
57
+ fi
58
+ done
59
+ - name : Upload deb artifact
60
+ uses : actions/upload-artifact@v3
61
+ with :
62
+ name : github-backup-utils_${{ github.event.inputs.version }}_all.deb
63
+ path : |
64
+ dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb
65
+ - name : Package tarball
66
+ run : |
67
+ ./script/package-tarball
68
+ - name : Upload tarball artifact
69
+ uses : actions/upload-artifact@v3
70
+ with :
71
+ name : github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
72
+ path : |
73
+ dist/github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
74
74
release :
75
75
# needs: build
76
76
runs-on : ubuntu-latest
@@ -86,47 +86,45 @@ jobs:
86
86
owner : ${{ github.repository_owner }}
87
87
repositories : " backup-utils,backup-utils-private"
88
88
- name : Checkout backup-utils
89
- if : github.event.inputs.branch_ref_or_commit == ''
90
89
uses : actions/checkout@v4
91
90
with :
92
91
token : ${{ steps.app-token.outputs.token }}
93
92
repository : github/backup-utils
94
- # ref: ${{ github.event.inputs.branch_ref_or_commit }}}
95
93
- name : Create empty commit
96
- if : github.event.inputs.branch_ref_or_commit == ''
94
+ if : github.event.inputs.release_commit_branch == ''
97
95
uses : stefanzweifel/git-auto-commit-action@v4
98
96
id : empty-commit
99
97
with :
100
- branch : ${{ github.event.inputs.branch_ref_or_commit }}
98
+ branch : ${{ github.event.inputs.release_commit_branch }}
101
99
commit_message : " Test ${{ github.event.inputs.version }} release commit"
102
100
commit_user_name : " release-controller[bot]"
103
101
commit_user_email : " 223695+release-controller[bot]@users.noreply.github.com"
104
102
commit_options : " --allow-empty"
105
103
push_options : " --force"
106
104
skip_dirty_check : true
107
- - name : Resolve release commit
108
- id : resolve-release-commit
109
- run : |
110
- if [[ -z "${{ github.event.inputs.branch_ref_or_commit }}" ]]; then
111
- echo "Using empty commit sha for release commit"
112
- echo "release-ref-or-commit=\"${{ steps.empty-commit.outputs.commit_hash }}\"" >> "$GITHUB_OUTPUT"
113
- else
114
- echo "Using provided commit sha for release commit"
115
- echo "release-ref-or-commit=\"${{ github.event.inputs.branch_ref_or_commit }}\"" >> "$GITHUB_OUTPUT"
116
- fi
105
+ # - name: Resolve release commit
106
+ # id: resolve-release-commit
107
+ # run: |
108
+ # if [[ -z "${{ github.event.inputs.release_commit_branch }}" ]]; then
109
+ # echo "Using empty commit sha for release commit"
110
+ # echo "release-ref-or-commit=\"${{ steps.empty-commit.outputs.commit_hash }}\"" >> "$GITHUB_OUTPUT"
111
+ # else
112
+ # echo "Using provided commit sha for release commit"
113
+ # echo "release-ref-or-commit=\"${{ github.event.inputs.release_commit_branch }}\"" >> "$GITHUB_OUTPUT"
114
+ # fi
117
115
- name : Checkout backup-utils-private for release notes
118
116
uses : actions/checkout@v4
119
117
with :
120
118
token : ${{ steps.app-token.outputs.token }}
121
119
repository : github/backup-utils-private
122
- # - name: Download deb artifact
123
- # uses: actions/download-artifact@v3
124
- # with:
125
- # name: github-backup-utils_${{ github.event.inputs.version }}_all.deb
126
- # - name: Download tarball artifact
127
- # uses: actions/download-artifact@v3
128
- # with:
129
- # name: github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
120
+ - name : Download deb artifact
121
+ uses : actions/download-artifact@v3
122
+ with :
123
+ name : github-backup-utils_${{ github.event.inputs.version }}_all.deb
124
+ - name : Download tarball artifact
125
+ uses : actions/download-artifact@v3
126
+ with :
127
+ name : github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
130
128
- name : Create Release
131
129
uses : ncipollo/release-action@v1
132
130
with :
@@ -135,11 +133,11 @@ jobs:
135
133
repo : backup-utils
136
134
name : |
137
135
GitHub Enterprise Server Backup Utilities v${{ github.event.inputs.version }}
138
- # artifacts: |
139
- # github-backup-utils-v${{ github.event.inputs.version }}.tar.gz, \
140
- # github-backup-utils_${{ github.event.inputs.version }}_all.deb
136
+ artifacts : |
137
+ github-backup-utils-v${{ github.event.inputs.version }}.tar.gz, \
138
+ github-backup-utils_${{ github.event.inputs.version }}_all.deb
141
139
tag : v${{ github.event.inputs.version }}
142
- commit : ${{ steps.resolve-release- commit.outputs.release-ref-or-commit }}
140
+ commit : ${{ steps.empty- commit.outputs.commit_hash }}
143
141
bodyFile : release-notes/${{ github.event.inputs.version }}.md
144
142
draft : ${{ github.event.inputs.draft }}
145
143
allowUpdates : true
0 commit comments