Skip to content

Commit 4e343a5

Browse files
committed
always empty commit on release branch
1 parent 7f738f0 commit 4e343a5

File tree

1 file changed

+79
-81
lines changed

1 file changed

+79
-81
lines changed

.github/workflows/build-and-release.yml

Lines changed: 79 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ on:
88
description: 'Version - patch version of the release (e.g. x.y.z)'
99
required: true
1010
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
1414
type: string
1515
draft:
1616
description: 'Draft - true if the release should be a draft'
@@ -19,58 +19,58 @@ on:
1919
default: true
2020

2121
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
7474
release:
7575
# needs: build
7676
runs-on: ubuntu-latest
@@ -86,47 +86,45 @@ jobs:
8686
owner: ${{ github.repository_owner }}
8787
repositories: "backup-utils,backup-utils-private"
8888
- name: Checkout backup-utils
89-
if: github.event.inputs.branch_ref_or_commit == ''
9089
uses: actions/checkout@v4
9190
with:
9291
token: ${{ steps.app-token.outputs.token }}
9392
repository: github/backup-utils
94-
# ref: ${{ github.event.inputs.branch_ref_or_commit }}}
9593
- name: Create empty commit
96-
if: github.event.inputs.branch_ref_or_commit == ''
94+
if: github.event.inputs.release_commit_branch == ''
9795
uses: stefanzweifel/git-auto-commit-action@v4
9896
id: empty-commit
9997
with:
100-
branch: ${{ github.event.inputs.branch_ref_or_commit }}
98+
branch: ${{ github.event.inputs.release_commit_branch }}
10199
commit_message: "Test ${{ github.event.inputs.version }} release commit"
102100
commit_user_name: "release-controller[bot]"
103101
commit_user_email: "223695+release-controller[bot]@users.noreply.github.com"
104102
commit_options: "--allow-empty"
105103
push_options: "--force"
106104
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
117115
- name: Checkout backup-utils-private for release notes
118116
uses: actions/checkout@v4
119117
with:
120118
token: ${{ steps.app-token.outputs.token }}
121119
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
130128
- name: Create Release
131129
uses: ncipollo/release-action@v1
132130
with:
@@ -135,11 +133,11 @@ jobs:
135133
repo: backup-utils
136134
name: |
137135
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
141139
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 }}
143141
bodyFile: release-notes/${{ github.event.inputs.version }}.md
144142
draft: ${{ github.event.inputs.draft }}
145143
allowUpdates: true

0 commit comments

Comments
 (0)