-
Notifications
You must be signed in to change notification settings - Fork 153
54 lines (46 loc) · 1.61 KB
/
cd_chocolatey.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
name: Publish to Chocolatey
on:
release:
types: [released]
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
valid-cli: ${{ steps.cli-name.outputs.valid }}
cli-vsn: ${{ steps.cli-name.outputs.cli-vsn }}
steps:
- name: Confirm that this is the release of ipinfo cli
id: cli-name
run: |
releaseName="${{ github.event.release.name }}"
if [[ $releaseName =~ ^ipinfo-([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
echo "Release name matches pattern 'ipinfo-x.x.x'"
echo "cli-vsn=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}" >> "$GITHUB_OUTPUT"
echo "valid=true" >> "$GITHUB_OUTPUT"
else
echo "Invalid release name format: $releaseName"
echo "Release name should be of format ipinfo-x.x.x"
fi
publish:
needs: check-release
if: needs.check-release.outputs.valid-cli == true
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install au module
run: |
choco install au -y
- name: Update package version
run: |
cd chocolatey-packages\ipinfo
.\update.ps1
- name: Test installation
run: |
cd chocolatey-packages\ipinfo
Test-Package
- name: Upload to choco
run: |
cd chocolatey-packages\ipinfo
choco apikey --key ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/
choco push ipinfo.${{ needs.check-release.outputs.cli-vsn }}.nupkg --source https://push.chocolatey.org/