-
-
Notifications
You must be signed in to change notification settings - Fork 1
591 lines (525 loc) · 23.1 KB
/
publish.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
---
# Based on https://github.com/nicolas-van/rust-cross-compile-example - Thanks!
name: Publish
on:
release:
types:
- published
workflow_dispatch:
pull_request: # for testing, when we change the workflow
branches:
- main
paths:
- .github/workflows/publish.yml
env:
CARGO_TERM_COLOR: always
defaults:
run:
# necessary for windows
shell: bash
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# 64-bit version of the x86 architecture for Linux-based systems with the GNU C Library (glibc)
- TARGET: x86_64-unknown-linux-gnu
OS: ubuntu-latest
# disabled, because ring package does not support musl
#- TARGET: x86_64-unknown-linux-musl # test in an alpine container on a mac
# OS: ubuntu-latest
# 64-bit version of the ARM architecture for Linux-based systems with the GNU C Library (glibc)
- TARGET: aarch64-unknown-linux-gnu # tested on aws t4g.nano
OS: ubuntu-latest
# disabled, because ring package does not support musl
#- TARGET: aarch64-unknown-linux-musl # tested on aws t4g.nano in alpine container
# OS: ubuntu-latest
# 32-bit version of the ARM architecture for Linux-based systems with the GNU C Library (glibc) and hardware floating-point support
- TARGET: armv7-unknown-linux-gnueabihf
OS: ubuntu-latest
# disabled, because ring package does not support musl
#- TARGET: armv7-unknown-linux-musleabihf # raspberry pi 2-3-4, not tested
# OS: ubuntu-latest
# 32-bit version of the ARM architecture for Linux-based systems with the GNU C Library (glibc) and hardware floating-point support
- TARGET: arm-unknown-linux-gnueabihf
OS: ubuntu-latest
# disabled, because ring package does not support musl
#- TARGET: arm-unknown-linux-musleabihf # raspberry pi 0-1, not tested
# OS: ubuntu-latest
# 64-bit version of the x86 architecture for macOS
- TARGET: x86_64-apple-darwin
OS: macos-latest
# 64-bit version of the ARM architecture for macOS
- target: aarch64-apple-darwin
OS: macos-latest
# 64-bit version of the x86 architecture for Windows-based systems with the Microsoft Visual C++ (MSVC) runtime
- TARGET: x86_64-pc-windows-msvc
OS: windows-latest
# 64-bit version of the x86 architecture for Windows-based systems with the GNU C Library (glibc) and GNU Compiler Collection (GCC)
- TARGET: x86_64-pc-windows-gnu
OS: windows-latest
# 32-bit version of the x86 architecture for Windows-based systems with the Microsoft Visual C++ (MSVC) runtime
- TARGET: i686-pc-windows-msvc
OS: windows-latest
# 32-bit version of the x86 architecture for Linux-based systems with the GNU C Library (glibc)
- TARGET: i686-unknown-linux-gnu
OS: ubuntu-latest
runs-on: ${{ matrix.OS }}
env:
NAME: cfn-teleport
TARGET: ${{ matrix.TARGET }}
OS: ${{ matrix.OS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Dependency cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
./target
key: ${{ runner.os }}-${{ matrix.TARGET }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.TARGET }}-target-
- name: Install and configure dependencies
run: |
# dependencies are only needed on ubuntu as that's the only place where
# we make cross-compilation
if [[ "${OS}" =~ ^ubuntu.*$ ]]; then
sudo apt-get install -qq crossbuild-essential-arm64 crossbuild-essential-armhf
fi
if [[ "${TARGET}" =~ ^.*-musl(eabihf?)$ ]]; then
sudo apt-get install musl-tools
fi
if [[ "${TARGET}" == "i686-unknown-linux-gnu" ]]; then
sudo apt-get install gcc-multilib
fi
- name: Install rust target
run: rustup target add "${TARGET}"
- name: Run build
run: cargo build --release --verbose --target "${TARGET}"
- name: List target
run: find ./target
- name: Compress
id: compress
run: |
mkdir -p ./artifacts
VERSION="${GITHUB_REF_NAME}"
if ! [[ "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="v9.9.9"
fi
if [[ $OS =~ ^windows.*$ ]]; then
SRC=$NAME.exe
ARTIFACT="./artifacts/${NAME}-${TARGET}-${VERSION}.exe"
elif [[ $OS =~ ^macos.*$ ]]; then
SRC=$NAME
ARTIFACT="./artifacts/${NAME}-${TARGET}-${VERSION}.dmg"
else
SRC=$NAME
ARTIFACT="./artifacts/${NAME}-${TARGET}-${VERSION}.tar.gz"
fi
mv "./target/$TARGET/release/${SRC}" "./${SRC}"
if [[ $OS =~ ^windows.*$ ]]; then
# there is no reduction in size for the exe
# tar.exe -a -c -f "${ARTIFACT}" "${SRC}"
mv "./${SRC}" "${ARTIFACT}"
elif [[ $OS =~ ^macos.*$ ]]; then
mkdir -p dmg
cp "./${SRC}" dmg
hdiutil create cfn-teleport.dmg -ov -volname "cfn-teleport" -fs HFS+ -srcfolder "dmg"
hdiutil convert cfn-teleport.dmg -format UDZO -o "${ARTIFACT}"
else
tar -czf "${ARTIFACT}" "${SRC}"
fi
if [[ ! $OS =~ ^windows.*$ ]]; then
ls -lh "${SRC}" "${ARTIFACT}"
fi
echo "ARTIFACT=${ARTIFACT}" >> $GITHUB_OUTPUT
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
./artifacts
- name: Attach artifact to release
run: |
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
gh release upload "${GITHUB_REF_NAME}" "${ARTIFACT}"
else
echo "Not uploading artifact to release because this is a pull request"
ls -l "${ARTIFACT}"
fi
env:
GH_TOKEN: ${{ secrets.OVERRIDE_TOKEN }}
ARTIFACT: ${{ steps.compress.outputs.ARTIFACT }}
cargo-publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Dependency cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
./target
key: ubuntu-latest-x86_64-unknown-linux-gnu-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
ubuntu-latest-x86_64-unknown-linux-gnu-target-
- name: Publish to crates.io
run: |
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
cargo publish
else
cargo publish --dry-run
fi
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
homebrew-publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: udondan/homebrew-software
token: ${{ secrets.OVERRIDE_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
- name: Update homebrew formula
run: |
VERSION="${GITHUB_REF_NAME}"
if ! [[ "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="v9.9.9"
fi
AARM=($(shasum -a 256 artifacts/cfn-teleport-aarch64-apple-darwin-${VERSION}.dmg))
AINTEL=($(shasum -a 256 artifacts/cfn-teleport-x86_64-apple-darwin-${VERSION}.dmg))
LARM32=($(shasum -a 256 artifacts/cfn-teleport-arm-unknown-linux-gnueabihf-${VERSION}.tar.gz))
LARM64=($(shasum -a 256 artifacts/cfn-teleport-aarch64-unknown-linux-gnu-${VERSION}.tar.gz))
LINTEL32=($(shasum -a 256 artifacts/cfn-teleport-i686-unknown-linux-gnu-${VERSION}.tar.gz))
LINTEL64=($(shasum -a 256 artifacts/cfn-teleport-x86_64-unknown-linux-gnu-${VERSION}.tar.gz))
echo "${TEMPLATE}" | sed \
-e "s!{{ version }}!${VERSION:1}!g" \
-e "s!{{ a_intel_file }}!$(basename ${AINTEL[1]})!g" \
-e "s!{{ a_intel_sha }}!${AINTEL[0]}!g" \
-e "s!{{ a_arm_file }}!$(basename ${AARM[1]})!g" \
-e "s!{{ a_arm_sha }}!${AARM[0]}!g" \
-e "s!{{ l_intel32_file }}!$(basename ${LINTEL32[1]})!g" \
-e "s!{{ l_intel32_sha }}!${LINTEL32[0]}!g" \
-e "s!{{ l_intel64_file }}!$(basename ${LINTEL64[1]})!g" \
-e "s!{{ l_intel64_sha }}!${LINTEL64[0]}!g" \
-e "s!{{ l_arm32_file }}!$(basename ${LARM32[1]})!g" \
-e "s!{{ l_arm32_sha }}!${LARM32[0]}!g" \
-e "s!{{ l_arm64_file }}!$(basename ${LARM64[1]})!g" \
-e "s!{{ l_arm64_sha }}!${LARM64[0]}!g" \
> cfn-teleport.rb
cat cfn-teleport.rb
rm -rf artifacts
git diff
git add cfn-teleport.rb
git status
git config --global user.email "${EMAIL}"
git config --global user.name "udondan"
git commit -m "Release ${VERSION:1}"
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
git push
fi
env:
EMAIL: ${{ secrets.EMAIL }}
NAME: ${{ secrets.NAME }}
TEMPLATE: |
# typed: false
# frozen_string_literal: true
class CfnTeleport < Formula
desc "A command line-tool which can move CloudFormation resources between stacks"
homepage "${{ github.server_url }}/${{ github.repository }}"
version "{{ version }}"
license "Apache-2.0"
if OS.mac?
if Hardware::CPU.intel?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ a_intel_file }}"
sha256 "{{ a_intel_sha }}"
elsif Hardware::CPU.arm?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ a_arm_file }}"
sha256 "{{ a_arm_sha }}"
end
elsif OS.linux?
if Hardware::CPU.arm?
if Hardware::CPU.is_64_bit?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ l_arm64_file }}"
sha256 "{{ l_arm64_sha }}"
elsif Hardware::CPU.is_32_bit?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ l_arm32_file }}"
sha256 "{{ l_arm32_sha }}"
end
elsif Hardware::CPU.intel?
if Hardware::CPU.is_64_bit?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ l_intel64_file }}"
sha256 "{{ l_intel64_sha }}"
elsif Hardware::CPU.is_32_bit?
url "${{ github.server_url }}/${{ github.repository }}/releases/download/v{{ version }}/{{ l_intel32_file }}"
sha256 "{{ l_intel32_sha }}"
end
end
end
def install
bin.install "cfn-teleport"
end
end
aur-publish:
needs: build
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
- name: Install and configure requirements
run: |
pacman -Sy --noconfirm --needed base-devel git openssh
mkdir /home/foo
useradd foo -d /home/foo
chown foo:foo /home/foo
echo "foo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/foo
mkdir -p ~/.ssh/tmp
echo "${SSH_CONF}" > /etc/ssh/ssh_config
echo "${{ secrets.AUR_SSH_KEY }}" > /etc/ssh/id_ed25519
chmod 600 /etc/ssh/id_ed25519
ssh-keyscan aur.archlinux.org >> /etc/ssh/ssh_known_hosts
env:
SSH_CONF: |
Host aur.archlinux.org
User aur
IdentityFile /etc/ssh/id_ed25519
PreferredAuthentications publickey
StrictHostKeyChecking yes
- name: Update PKGBUILD
run: |
git clone "ssh://aur.archlinux.org/cfn-teleport.git" --depth=1
cd cfn-teleport
VERSION="${GITHUB_REF_NAME}"
if ! [[ "${VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="v9.9.9"
fi
ARM=($(sha256sum ../artifacts/cfn-teleport-arm-unknown-linux-gnueabihf-${VERSION}.tar.gz))
X86_64=($(sha256sum ../artifacts/cfn-teleport-x86_64-unknown-linux-gnu-${VERSION}.tar.gz))
AARCH64=($(sha256sum ../artifacts/cfn-teleport-aarch64-unknown-linux-gnu-${VERSION}.tar.gz))
ARMV7H=($(sha256sum ../artifacts/cfn-teleport-armv7-unknown-linux-gnueabihf-${VERSION}.tar.gz))
I686=($(sha256sum ../artifacts/cfn-teleport-i686-unknown-linux-gnu-${VERSION}.tar.gz))
echo "${TEMPLATE}" | sed \
-e "s!{{ version }}!${VERSION:1}!g" \
-e "s!{{ arm_file }}!$(basename ${ARM[1]})!g" \
-e "s!{{ arm_sha }}!${ARM[0]}!g" \
-e "s!{{ x86_64_file }}!$(basename ${X86_64[1]})!g" \
-e "s!{{ x86_64_sha }}!${X86_64[0]}!g" \
-e "s!{{ aarch64_file }}!$(basename ${AARCH64[1]})!g" \
-e "s!{{ aarch64_sha }}!${AARCH64[0]}!g" \
-e "s!{{ armv7h_file }}!$(basename ${ARMV7H[1]})!g" \
-e "s!{{ armv7h_sha }}!${ARMV7H[0]}!g" \
-e "s!{{ i686_file }}!$(basename ${I686[1]})!g" \
-e "s!{{ i686_sha }}!${I686[0]}!g" \
> PKGBUILD
echo "##### PKGBUILD #####"
cat PKGBUILD
chown -R foo:foo .
runuser -l foo -c "cd $PWD;makepkg --printsrcinfo > .SRCINFO"
chown -R root:root .
echo "##### .SRCINFO #####"
cat .SRCINFO
echo "####################"
git status
git diff
git config --global user.email "${EMAIL}"
git config --global user.name "udondan"
git commit -am "Release ${VERSION:1}"
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
git push
fi
env:
EMAIL: ${{ secrets.EMAIL }}
NAME: ${{ secrets.NAME }}
TEMPLATE: |
# Maintainer: ${{ secrets.NAME }} <${{ secrets.EMAIL }}>
# Maintainer: ${{ secrets.NAME2 }} <${{ secrets.EMAIL2 }}>
pkgname=cfn-teleport
pkgver={{ version }}
pkgrel=1
pkgdesc="A command-line tool which can move CloudFormation resources between stacks"
arch=("aarch64" "arm" "armv7h" "i686" "x86_64")
url="${{ github.server_url }}/${{ github.repository }}"
license=("APACHE")
# Source files
source_aarch64=("${url}/releases/download/v${pkgver}/cfn-teleport-aarch64-unknown-linux-gnu-v${pkgver}.tar.gz")
source_arm=("${url}/releases/download/v${pkgver}/cfn-teleport-arm-unknown-linux-gnueabihf-v${pkgver}.tar.gz")
source_armv7h=("${url}/releases/download/v${pkgver}/cfn-teleport-armv7-unknown-linux-gnueabihf-v${pkgver}.tar.gz")
source_i686=("${url}/releases/download/v${pkgver}/cfn-teleport-i686-unknown-linux-gnu-v${pkgver}.tar.gz")
source_x86_64=("${url}/releases/download/v${pkgver}/cfn-teleport-x86_64-unknown-linux-gnu-v${pkgver}.tar.gz")
# Checksums
sha256sums_aarch64=("{{ aarch64_sha }}")
sha256sums_arm=("{{ arm_sha }}")
sha256sums_armv7h=("{{ armv7h_sha }}")
sha256sums_i686=("{{ i686_sha }}")
sha256sums_x86_64=("{{ x86_64_sha }}")
# Build function
build() {
return 0
}
# Package functions
package() {
# Extract the package based on the current architecture
case "$CARCH" in
'aarch64') tar -xzf "${srcdir}/cfn-teleport-aarch64-unknown-linux-gnu-v${pkgver}.tar.gz" -C "${srcdir}/" ;;
'arm') tar -xzf "${srcdir}/cfn-teleport-arm-unknown-linux-gnueabihf-v${pkgver}.tar.gz" -C "${srcdir}/" ;;
'armv7h') tar -xzf "${srcdir}/cfn-teleport-armv7-unknown-linux-gnueabihf-v${pkgver}.tar.gz" -C "${srcdir}/" ;;
'i686') tar -xzf "${srcdir}/cfn-teleport-i686-unknown-linux-gnu-v${pkgver}.tar.gz" -C "${srcdir}/" ;;
'x86_64') tar -xzf "${srcdir}/cfn-teleport-x86_64-unknown-linux-gnu-v${pkgver}.tar.gz" -C "${srcdir}/" ;;
esac
# Move the binary to /usr/bin
install -Dm755 "${srcdir}/cfn-teleport" "${pkgdir}/usr/bin/cfn-teleport"
}
# chocolatey-publish:
# needs: build
# runs-on: windows-latest
# defaults:
# run:
# shell: powershell
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# persist-credentials: false
# fetch-depth: 0
#
# - uses: actions/download-artifact@v3
# with:
# name: artifacts
# path: artifacts
#
# - name: Generate chocolatey package
# run: |
# if (-not $Env:NUSPEC) {
# Write-Error "NUSPEC variable not set"
# exit 1
# }
#
# $markdown = Get-Content -Path "CHANGELOG.md" -Raw
# $startIndex = $markdown.IndexOf("## [", 0)
# $endIndex = $markdown.IndexOf("## [", $startIndex + 1)
# $releaseNotes = $markdown.Substring($startIndex, $endIndex - $startIndex)
#
# $nuspec = $Env:NUSPEC
# $installScript = $Env:INSTALL_SCRIPT
#
# $version = $Env:GITHUB_REF_NAME -replace '^v', ''
# if ($version -notmatch '^\d+\.\d+\.\d+$') {
# $version = '9.9.9'
# }
#
# # Get the file paths
# $url32File = "${{ github.workspace }}/artifacts/cfn-teleport-i686-pc-windows-msvc-v{0}.exe" -f $version
# $url64File = "${{ github.workspace }}/artifacts/cfn-teleport-x86_64-pc-windows-msvc-v{0}.exe" -f $version
#
# # Get the SHA256 hashes
# $sha32 = Get-FileHash $url32File -Algorithm SHA256 | Select-Object -ExpandProperty Hash
# $sha64 = Get-FileHash $url64File -Algorithm SHA256 | Select-Object -ExpandProperty Hash
#
# # Build the URLs
# $url32 = "https://github.com/udondan/cfn-teleport/releases/download/v{0}/cfn-teleport-i686-pc-windows-msvc-v{0}.exe" -f $version
# $url64 = "https://github.com/udondan/cfn-teleport/releases/download/v{0}/cfn-teleport-x86_64-pc-windows-msvc-v{0}.exe" -f $version
#
# # Replace the placeholders in the nuspec and script files
# $nuspecContent = $nuspec.Replace('{{ url32 }}', $url32).Replace('{{ sha32 }}', $sha32).Replace('{{ url64 }}', $url64).Replace('{{ sha64 }}', $sha64).Replace('{{ version }}', $version).Replace('{{ release_notes }}', $releaseNotes)
# $installScriptContent = $installScript.Replace('{{ url32 }}', $url32).Replace('{{ sha32 }}', $sha32).Replace('{{ url64 }}', $url64).Replace('{{ sha64 }}', $sha64).Replace('{{ version }}', $version)
#
# # Write nuspec and script files
# $nuspecPath = "${{ github.workspace }}/cfn-teleport.nuspec"
# Set-Content -Path $nuspecPath -Value $nuspecContent
#
# $toolsDir = "${{ github.workspace }}/tools"
# New-Item -ItemType Directory -Force -Path $toolsDir
# $installScriptPath = "${{ github.workspace }}/tools/chocolateyInstall.ps1"
# Set-Content -Path $installScriptPath -Value $installScriptContent
#
# # Output file content
# echo "#### cfn-teleport.nuspec ####"
# echo "$nuspecContent"
# echo "#### chocolateyInstall.ps1 ####"
# echo "$installScriptContent"
#
# # Create package
# echo "Creating package..."
# choco pack $nuspecPath
#
# if ("${{ github.event_name }}" -ne "pull_request") {
# # Test installation
# echo "Installing package..."
# $nupgkFile = "${{ github.workspace }}/cfn-teleport.{0}.nupkg" -f $version
# choco install cfn-teleport --source $nupgkFile --yes
#
# # Check if installation was successful
# echo "Checking if package was installed..."
# Get-Command cfn-teleport
# cfn-teleport.exe --version
#
# # Uninstall package
# echo "Uninstalling package..."
# choco uninstall cfn-teleport --yes
#
# # Ensure package is uninstalled
# echo "Checking if package was uninstalled..."
# if (Get-Command cfn-teleport -ErrorAction SilentlyContinue) {
# Write-Error "Package was not uninstalled"
# exit 1
# }
#
# # Push package
# echo "Pushing package..."
# choco push $nupgkFile --source https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }}
# }
# env:
# NUSPEC: |
# <?xml version="1.0"?>
# <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
# <metadata>
# <id>cfn-teleport</id>
# <title>cfn-teleport</title>
# <version>{{ version }}</version>
# <authors>udondan</authors>
# <description>A command-line tool which can move CloudFormation resources between stacks</description>
# <summary>A command-line tool which can move CloudFormation resources between stacks</summary>
# <tags>aws cloudformation migration</tags>
# <licenseUrl>https://github.com/udondan/cfn-teleport/blob/master/LICENSE</licenseUrl>
# <projectUrl>https://github.com/udondan/cfn-teleport</projectUrl>
# <packageSourceUrl>https://github.com/udondan/cfn-teleport/blob/main/.github/workflows/publish.yml</packageSourceUrl>
# <releaseNotes>{{ release_notes }}</releaseNotes>
# </metadata>
# <files>
# <file src="tools\**" target="tools" />
# </files>
# </package>
# INSTALL_SCRIPT: |
# $packageName = 'cfn-teleport'
# $version = '{{ version }}'
# $installDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
#
# $fileArgs = @{
# packageName = $packageName
# fileFullPath = Join-Path $installDir 'cfn-teleport.exe'
# url = '{{ url32 }}'
# checksum = '{{ sha32 }}'
# url64bit = '{{ url64 }}'
# checksum64 = '{{ sha64 }}'
# checksumType = 'sha256'
# ChecksumType64 = 'sha256'
# }
# Get-ChocolateyWebFile @fileArgs