Skip to content

Commit 5525263

Browse files
committed
another try
1 parent 503bc84 commit 5525263

File tree

1 file changed

+38
-65
lines changed

1 file changed

+38
-65
lines changed

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

Lines changed: 38 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ name: Build and Release
44
on:
55
workflow_dispatch:
66
inputs:
7+
gh-token:
8+
description: 'GitHub Token - used to create a commit in the backup-utils repo'
9+
required: true
10+
type: string
711
version:
812
description: 'Version - patch version of the release (e.g. x.y.z)'
913
required: true
@@ -31,37 +35,31 @@ jobs:
3135
with:
3236
token: ${{ steps.app-token.outputs.token }}
3337
repository: github/backup-utils
34-
# set GITHUB_TOKEN to the app token
35-
- name: Set GITHUB_TOKEN
36-
run: |
37-
echo "GITHUB_TOKEN=${{ steps.app-token.outputs.token }}" >> $GITHUB_ENV
38-
- uses: stefanzweifel/git-auto-commit-action@v4
38+
ref: master
39+
- name: Create empty commit in backup-utils
3940
id: empty-commit
40-
with:
41-
branch: tims-test-branch
42-
commit_message: "${{ github.event.inputs.version }} release"
43-
commit_options: "--allow-empty"
44-
skip_dirty_check: true
45-
# - name: Create empty commit in backup-utils
46-
# id: empty-commit
47-
# env:
48-
# ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
49-
# run: |
50-
# git config user.name "release-controller[bot]"
51-
# git config user.email "[email protected]"
52-
# git remote set-url origin https://[email protected]/github/backup-utils.git
53-
# git fetch origin tims-test-branch
54-
# git checkout tims-test-branch
55-
# git commit --allow-empty -m "${{ github.event.inputs.version }} release"
56-
# git push origin tims-test-branch
57-
# echo "commit-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
58-
# create tags for the build scripts to work
59-
# if empty_commit is successful, then echo success
60-
- name: Echo success
61-
if: ${{ steps.empty-commit.outcome == 'success' }}
6241
run: |
63-
echo "empty commit successful"
64-
# - name: Create tag
42+
git config user.name "timreimherr"
43+
git config user.email "[email protected]"
44+
git fetch origin tims-test-branch
45+
git checkout tims-test-branch
46+
git commit --allow-empty -m "${{ github.event.inputs.version }} release"
47+
git push origin tims-test-branch
48+
echo "commit-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
49+
- name: Echo Success if commit was created
50+
if: steps.empty-commit.outputs.commit-sha != ''
51+
run: |
52+
echo "Success"
53+
# - name: Checkout backup-utils-private
54+
# uses: actions/checkout@v4
55+
# with:
56+
# token: ${{ steps.app-token.outputs.token }}
57+
# repository: github/backup-utils-private
58+
# - name: Install dependencies
59+
# run: |
60+
# sudo apt-get update -y
61+
# sudo apt-get install -y moreutils debhelper help2man devscripts gzip
62+
# - name: Create tag # this is required for the build scripts
6563
# run: |
6664
# git config user.name "release-controller[bot]"
6765
# git config user.email "[email protected]"
@@ -97,38 +95,31 @@ jobs:
9795
# needs: build
9896
# runs-on: ubuntu-latest
9997
# outputs:
100-
# commit-sha: ${{ steps.empty_commit.outputs.commit_sha }}
98+
# commit-sha: ${{ steps.empty-commit.outputs.commit-sha }}
10199
# steps:
102100
# - uses: timreimherr/create-github-app-token@main
103101
# id: app-token
104102
# with:
105-
# # required
106103
# app_id: ${{ vars.RELEASE_CONTROLLER_APP_ID }}
107104
# private_key: ${{ secrets.RELEASE_CONTROLLER_APP_PRIVATE_KEY }}
108105
# owner: ${{ github.repository_owner }}
109-
# repositories: |
110-
# github/backup-utils
111-
# github/backup-utils-private
112-
# - name: Checkout backup-utils-private
113-
# uses: actions/checkout@v4
114-
# with:
115-
# token: ${{ steps.app-token.outputs.token }}
116-
# repository: github/backup-utils-private
117-
# path: backup-utils-private
106+
# repositories: backup-utils,backup-utils-private
118107
# - name: Checkout backup-utils
119108
# uses: actions/checkout@v4
120109
# with:
121110
# token: ${{ steps.app-token.outputs.token }}
122111
# repository: github/backup-utils
123112
# ref: master
124-
# path: backup-utils
125113
# - name: Create empty commit in backup-utils
126-
# id: empty_commit
114+
# id: empty-commit
127115
# run: |
128-
# cp ./backup-utils-private/scripts/create-empty-commit \
129-
# .backup-utils/create-empty-commit
130-
# cd ./backup-utils
131-
# ./create-empty-commit
116+
# git config user.name "release-controller[bot]"
117+
# git config user.email "[email protected]"
118+
# git fetch origin tims-test-branch
119+
# git checkout tims-test-branch
120+
# git commit --allow-empty -m "${{ github.event.inputs.version }} release"
121+
# git push origin tims-test-branch
122+
# echo "commit-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
132123
# - name: Download deb artifact
133124
# uses: actions/download-artifact@v3
134125
# with:
@@ -151,7 +142,7 @@ jobs:
151142
# # this action will create a tag with this name on the provided commit
152143
# tag: v${{ github.event.inputs.version }}
153144
# # this can be a commit hash or branch name
154-
# commit: ${{ steps.empty_commit.outputs.commit_sha }}
145+
# commit: ${{ steps.empty-commit.outputs.commit_sha }}
155146
# bodyFile: release-notes/${{ github.event.inputs.version }}.md
156147
# draft: ${{ github.event.inputs.draft }}
157148
# allowUpdates: true
@@ -160,21 +151,3 @@ jobs:
160151

161152

162153

163-
164-
# - name: Checkout backup-utils-private
165-
# uses: actions/checkout@v4
166-
# with:
167-
# token: ${{ steps.app-token.outputs.token }}
168-
# repository: github/backup-utils-private
169-
# path: backup-utils-private
170-
# - name: Checkout backup-utils
171-
# uses: actions/checkout@v4
172-
# with:
173-
# token: ${{ steps.app-token.outputs.token }}
174-
# repository: github/backup-utils
175-
# ref: master
176-
# path: backup-utils
177-
# - name: Install dependencies
178-
# run: |
179-
# sudo apt-get update -y
180-
# sudo apt-get install -y moreutils debhelper help2man devscripts gzip

0 commit comments

Comments
 (0)