7
7
description : " anything you'd like recorded for this workflow run"
8
8
required : false
9
9
type : " string"
10
- default : " manually run workflow"
10
+ default : " user manually triggered workflow"
11
11
12
12
permissions :
13
13
contents : write
@@ -26,19 +26,26 @@ jobs:
26
26
run : |
27
27
echo "tag=`echo $(git describe --tags --abbrev=0)`"
28
28
echo "tag=`echo $(git describe --tags --abbrev=0)`" >> "$GITHUB_OUTPUT"
29
+
29
30
- name : Get upstream release
30
31
id : upstreamRelease
31
32
uses : pozetroninc/github-action-get-latest-release@master
32
33
with :
33
34
repository : small-hack/smol-k8s-lab
34
35
35
- - name : Update Release
36
+ - name : Update Release Version
36
37
run : |
37
- sed -i 's/${{ steps.localTag.outputs.tag }}/${{ steps.upstreamRelease.outputs.release }}/g' ./Formula/smol-k8s-lab.rb
38
- cat ./Formula/smol-k8s-lab.rb
39
- git config --global user.email "jessebot@linux.com"
40
- git config --global user.name "jessebot"
41
- git commit -m "Updating latest package from ${{ steps.localTag.outputs.tag }} to ${{ steps.upstreamRelease.outputs.release }}" ./Formula/smol-k8s-lab.rb
42
- git push
38
+ echo "replacing latest version"
39
+ sed -i 's/${{ steps.localTag.outputs.tag }}/${{ steps.upstreamRelease.outputs.release }}/g' ./Formula/smol-k8s-lab.rb && cat ./Formula/smol-k8s-lab.rb
40
+
41
+ echo "replacing the sha of old version with new version"
42
+ curl -O https://github.com/small-hack/smol-k8s-lab/archive/refs/tags/${{ steps.upstreamRelease.outputs.release }}.tar.gz
43
+ echo "sha=$(shasum -a 256 ${{ steps.upstreamRelease.outputs.release }}.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
44
+ echo "old_sha=$(grep sha ./Formula/smol-k8s-lab.rb | awk -F ' ' '{print $2}' | sed 's/"//g')" >> $GITHUB_ENV
45
+ sed -i 's/${{ env.old_sha }}/${{ env.sha }}/' ./Formula/smol-k8s-lab.rb && grep sha ./Formula/smol-k8s-lab.rb
46
+
47
+ echo "tagging and pushing to main branch"
43
48
git tag ${{ steps.upstreamRelease.outputs.release }}
44
- git push --tags
49
+ git config --global user.email "jessebot@linux.com" && git config --global user.name "jessebot"
50
+ git commit -m "Updating latest package from ${{ steps.localTag.outputs.tag }} to ${{ steps.upstreamRelease.outputs.release }}" ./Formula/smol-k8s-lab.rb
51
+ git push && git push --tags
0 commit comments