-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (27 loc) · 1.3 KB
/
create-choco-packages.yml
File metadata and controls
37 lines (27 loc) · 1.3 KB
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
name: Create choco packages
on: [workflow_dispatch,workflow_call]
defaults:
run:
shell: cmd
jobs:
build:
runs-on: windows-2022
steps:
- name: Check out current repository
uses: actions/checkout@v6
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v4
- name: Build and push the package
run: |
choco install checksum
curl -Ls https://github.com/ton-blockchain/ton/releases/latest/download/ton-win-x86-64.zip -o ton-win-x86-64.zip
FOR /F "tokens=*" %%g IN ('checksum -t sha256 -f ton-win-x86-64.zip') do (SET CHECK_SUM=%%g)
echo "checksum %CHECK_SUM%"
FOR /F "tokens=*" %%g IN ('git ls-remote --tags https://github.com/ton-blockchain/ton/ ^| tail -n 1 ^| sed -n -e "s/^.*tags\///p"') do ( SET TAG=%%g)
echo "latest TAG = %TAG%"
cd packages\chocolatey
sed -i -e "s/\(<version>\).*\(<\/version>\)/<version>%TAG:~1%<\/version>/g" ton.nuspec
sed -i -e "s/\(checksum64 = '\).*\('\)/checksum64 = '%CHECK_SUM%'/g" tools\chocolateyinstall.ps1
choco pack
choco apikey --api-key "${{ secrets.CHOCOLATEY_API_KEY }}" -source https://push.chocolatey.org/
choco push --source https://push.chocolatey.org/