-
Notifications
You must be signed in to change notification settings - Fork 39
65 lines (51 loc) · 2.42 KB
/
snap.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
---
name: "Snapcraft Release Pipeline"
on:
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
# - uses: snapcore/action-publish@v1
# with:
# store_login: ${{ secrets.STORE_LOGIN }}
# snap: ${{ steps.build.outputs.snap }}
# release: edge
- name: Update chocolatey checksums
run: |
echo "[INFO] Wait until all artefacts will be uploaded"
sleep 300
release_tag=${{ github.event.release.tag_name }}
release_version="${release_tag#v}"
echo "[INFO] Download release's checksums"
curl \
-SsL \
-o /tmp/checksums.txt \
https://github.com/tofuutils/tenv/releases/download/${release_tag}/tenv_${release_tag}_checksums.txt
echo "[INFO] Update chocolateyinstall.ps1"
choco_url="https://github.com/tofuutils/tenv/releases/download/${release_tag}/tenv_${release_tag}_Windows_i386.zip"
choco_url64="https://github.com/tofuutils/tenv/releases/download/${release_tag}/tenv_${release_tag}_Windows_x86_64.zip"
choco_sum="$(grep "tenv_${release_tag}_Windows_i386.zip" /tmp/checksums.txt | cut -d ' ' -f 1 | tr -d '\n')"
choco_sum64="$(grep "tenv_${release_tag}_Windows_x86_64.zip" /tmp/checksums.txt | cut -d ' ' -f 1 | tr -d '\n')"
sed -i "s~\$url = '.*'~\$url = '${choco_url}'~g" tenv/tools/chocolateyinstall.ps1
sed -i "s~\$url64 = '.*'~\$url64 = '${choco_url64}'~g" tenv/tools/chocolateyinstall.ps1
sed -i "s~\$checksum = '.*'~\$checksum = '${choco_sum}'~g" tenv/tools/chocolateyinstall.ps1
sed -i "s~\$checksum64 = '.*'~\$checksum64 = '${choco_sum64}'~g" tenv/tools/chocolateyinstall.ps1
echo "[INFO] Push changes back to git"
git config user.name tofuutils
git config user.email tofuutils@github.com
git add -A
git commit -m "Chocolatey scripts update for tenv version ${release_tag}"
git tag -a ${release_version} -m "${release_version}"
git push origin --tags main