-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (98 loc) · 2.98 KB
/
release.yml
File metadata and controls
112 lines (98 loc) · 2.98 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
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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SUPERMODEL_AUR_KEY: ${{ secrets.SUPERMODEL_AUR_KEY }}
- uses: actions/setup-node@v6
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Publish npm package
working-directory: npm
run: |
VERSION="${GITHUB_REF_NAME#v}"
npm version "$VERSION" --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.SUPERMODEL_NPM_TOKEN }}
wait-for-propagation:
name: wait for package propagation
needs: release
runs-on: ubuntu-latest
steps:
- name: Sleep 5 minutes
run: sleep 300
smoke-test:
name: smoke test / ${{ matrix.name }}
needs: wait-for-propagation
strategy:
fail-fast: false
matrix:
include:
- name: install.sh
os: ubuntu-latest
- name: npm
os: ubuntu-latest
- name: homebrew
os: macos-latest
- name: scoop
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install via install.sh
if: matrix.name == 'install.sh'
run: |
curl -fsSL https://supermodeltools.com/install.sh | SUPERMODEL_INSTALL_DIR="$HOME/.local/bin" SUPERMODEL_VERSION="${GITHUB_REF_NAME}" sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Install via npm
if: matrix.name == 'npm'
run: npm install -g @supermodeltools/cli
- name: Install via Homebrew
if: matrix.name == 'homebrew'
run: |
brew tap supermodeltools/cli https://github.com/supermodeltools/cli
brew install supermodeltools/cli/supermodel
- name: Install Scoop
if: matrix.name == 'scoop'
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
- name: Install via Scoop
if: matrix.name == 'scoop'
shell: pwsh
run: |
scoop bucket add supermodeltools https://github.com/supermodeltools/cli
scoop install supermodel
- name: Smoke test
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
supermodel --version
supermodel --version | grep -F "$VERSION"
supermodel --help
echo "✓ smoke test passed on ${{ matrix.name }}"