1+ ---
12name : Build and Release
23
34on :
45 workflow_dispatch :
56 inputs :
6- version :
7- description : ' Version - patch version of the release (e.g. x.y.z) '
7+ gh-token :
8+ description : ' GitHub Token - used to create a commit in the backup-utils repo '
89 required : true
910 type : string
10- release-notes :
11- description : ' Release Notes - string of markdown '
11+ version :
12+ description : ' Version - patch version of the release (e.g. x.y.z) '
1213 required : true
1314 type : string
1415 draft :
@@ -21,33 +22,118 @@ jobs:
2122 build :
2223 runs-on : ubuntu-latest
2324 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
35+ - name : Checkout backup-utils-private
36+ uses : actions/checkout@v4
37+ with :
38+ token : ${{ github.event.inputs.gh-token }}
39+ repository : github/backup-utils-private
2440 - name : Install dependencies
2541 run : |
26- sudo apt-get update
27- sudo apt-get install -y moreutils debhelper help2man
28- - name : Create tag
42+ sudo apt-get update -y
43+ sudo apt-get install -y moreutils debhelper help2man devscripts gzip
44+ - name : Create tag # this is required for the build scripts
2945 run : |
30- git tag -a v${{ github.event.inputs.version }} -m "v${{ github.event.inputs.version }}"
31- - name : Checkout
32- uses : actions/checkout@v2
46+ git config user.name "${{ github.actor }}"
47+ git config user.email "[email protected] " 48+ git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}"
49+ git push origin "v${{ github.event.inputs.version }}"
3350 - name : Package deb
3451 run : |
35- bash scripts/package-deb
52+ ./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+ - name : Upload deb artifact
62+ uses : actions/upload-artifact@v3
63+ with :
64+ name : github-backup-utils_${{ github.event.inputs.version }}_all.deb
65+ path : |
66+ dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb
3667 - name : Package tarball
3768 run : |
38- bash scripts/package-tarball
69+ ./script/package-tarball
70+ - name : Upload tarball artifact
71+ uses : actions/upload-artifact@v3
72+ with :
73+ name : github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
74+ path : |
75+ dist/github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
3976 release :
4077 needs : build
4178 runs-on : ubuntu-latest
79+ outputs :
80+ commit_hash : ${{ steps.empty-commit.outputs.commit_hash }}
4281 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
91+ - name : Checkout backup-utils
92+ uses : actions/checkout@v4
93+ with :
94+ token : ${{ github.event.inputs.gh-token }}
95+ repository : github/backup-utils
96+ ref : master
97+ - name : Create empty commit
98+ uses : stefanzweifel/git-auto-commit-action@v4
99+ id : empty-commit
100+ with :
101+ branch : master
102+ commit_message : " ${{ github.event.inputs.version }} release"
103+ commit_user_name : " ${{ github.actor }}"
104+ commit_user_email :
" [email protected] " 105+ commit_options : " --allow-empty"
106+ skip_dirty_check : true
107+ - name : Checkout backup-utils
108+ uses : actions/checkout@v4
109+ with :
110+ token : ${{ github.event.inputs.gh-token }}
111+ repository : github/backup-utils-private
112+ - name : Download deb artifact
113+ uses : actions/download-artifact@v3
114+ with :
115+ name : github-backup-utils_${{ github.event.inputs.version }}_all.deb
116+ - name : Download tarball artifact
117+ uses : actions/download-artifact@v3
118+ with :
119+ name : github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
43120 - name : Create Release
44121 uses : ncipollo/release-action@v1
45122 with :
46- repo : github/backup-utils
123+ token : ${{ github.event.inputs.gh-token }}
124+ repo : backup-utils
125+ name : |
126+ GitHub Enterprise Server Backup Utilities v${{ github.event.inputs.version }}
47127 artifacts : |
48- ./dist/github-backup-utils-v${{ github.event.inputs.version }}.tar.gz
49- ./dist/github-backup-utils_${{ github.event.inputs.version }}_all.deb
50- # token: ${{ secrets.GITHUB_TOKEN }} may need token, but try without first
51- name : v${{ github.event.inputs.version }}
128+ github-backup-utils-v${{ github.event.inputs.version }}.tar.gz, \
129+ github-backup-utils_${{ github.event.inputs.version }}_all.deb
130+ tag : v${{ github.event.inputs.version }}
131+ commit : ${{ steps.empty-commit.outputs.commit_hash }}
132+ bodyFile : release-notes/${{ github.event.inputs.version }}.md
52133 draft : ${{ github.event.inputs.draft }}
53- body : ${{ github.event.inputs.release-notes }}
134+ allowUpdates : true
135+ artifactContentType : " raw"
136+
137+
138+
139+
0 commit comments