-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (57 loc) · 1.92 KB
/
update.yaml
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
68
69
70
71
72
73
74
75
76
name: update-brew
on:
workflow_dispatch:
inputs:
version:
description: 'Version of the release'
required: true
URL:
description: 'URL to the .tar of the release'
required: true
jobs:
edit-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tagstep.outputs.tag }}
url: ${{ steps.urlstep.outputs.url }}
steps:
- id: tagstep
run: |
export TAG=${{ github.event.inputs.version }}
export TAG=${TAG#*refs/tags/}
echo $TAG
echo "::set-output name=tag::$TAG"
- id: urlstep
run: |
export URL=${{ github.event.inputs.URL }}
echo $URL
echo "::set-output name=url::$URL"
commit-tags:
needs: edit-tag
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: changes on prqlc.rb
run: |
export TAG=${{ needs.edit-tag.outputs.tag }}
export TAG=\"${TAG}\"
echo $TAG
export URL=${{ needs.edit-tag.outputs.url }}
export URL=\"${URL}\"
echo $URL
wget ${{ needs.edit-tag.outputs.url }}
echo shasum -a 256 ${{ needs.edit-tag.outputs.tag }}.tar.gz
export SHA=$(shasum -a 256 ${{ needs.edit-tag.outputs.tag }}.tar.gz)
export SHA=$(echo $SHA | cut -f 1 -d ' ')
export SHA=\"${SHA}\"
echo $SHA
cd Formula
sed -i "4 s@url .*@url $URL@" "prqlc.rb"
sed -i "5 s/sha256 .*/sha256 $SHA/" "prqlc.rb"
git config user.name github-actions
git config user.email github-actions@github.com
git add .
export TAG=${{ needs.edit-tag.outputs.tag }}
git commit -m "Automated update of tag and SHA256: $TAG"
git push