-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 2.21 KB
/
release-with-homebrew.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: release-with-homebrew
on: workflow_dispatch
jobs:
release-job:
name: 'Release and update Homebrew'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- uses: touchlab/read-property@0.1
id: version-name
with:
file: ./gradle.properties
property: VERSION_NAME
- name: Echo Version
run: echo "${{ steps.version-name.outputs.propVal }}"
- name: 'Create Release'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{ steps.version-name.outputs.propVal }}
release_name: 'Release ${{ steps.version-name.outputs.propVal }}'
body: |
Initial release
draft: false
prerelease: false
- name: 'Find release commit sha'
run: |
git fetch --tags
git rev-parse ${{ steps.version-name.outputs.propVal }} > releasesha
- name: Read git commit sha into variable
id: releasesha
run: echo "::set-output name=releasesha::$(cat releasesha)"
- name: Apply SSH Key
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.GITPORTAL_SSH_KEY }}
- name: 'Checkout homebrew tap'
uses: actions/checkout@v4
with:
repository: 'touchlab/homebrew-gitportal'
ref: 'main'
path: 'homebrew'
- name: 'Update homebrew tap info'
run: |
cd homebrew
sed -i'' -e 's/tag:.*$/tag: "${{ steps.version-name.outputs.propVal }}",/g' Formula/gitportal.rb
sed -i'' -e 's/revision:.*$/revision: "${{ steps.releasesha.outputs.releasesha }}"/g' Formula/gitportal.rb
sed -i'' -e 's/tag:.*$/tag: "${{ steps.version-name.outputs.propVal }}",/g' Formula/gitportal-rc.rb
sed -i'' -e 's/revision:.*$/revision: "${{ steps.releasesha.outputs.releasesha }}"/g' Formula/gitportal-rc.rb
git config --global user.email "kgalligan@gmail.com"
git config --global user.name "Kevin Galligan"
git add .
git commit -m "Add version ${{ steps.version-name.outputs.propVal }}"
git push