fix(release): pin install.sh version from tag, install Scoop before u… #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SUPERMODEL_HOMEBREW_TAP_TOKEN: ${{ secrets.SUPERMODEL_HOMEBREW_TAP_TOKEN }} | |
| SUPERMODEL_SCOOP_BUCKET_TOKEN: ${{ secrets.SUPERMODEL_SCOOP_BUCKET_TOKEN }} | |
| SUPERMODEL_AUR_KEY: ${{ secrets.SUPERMODEL_AUR_KEY }} | |
| - uses: actions/setup-node@v4 | |
| 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 install supermodeltools/tap/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/scoop-bucket | |
| 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 }}" |