Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

update prefix again (#115) #31

update prefix again (#115)

update prefix again (#115) #31

Workflow file for this run

name: Release CLI
on:
push:
tags:
- v*
permissions:
contents: write
id-token: write
jobs:
release:
# note: must use GitHub-hosted runner for publishing to NPM with --provenance flag
runs-on: ubuntu-latest
name: Release
steps:
- name: Validate version
if: ${{ !startsWith(github.ref_name, 'v') }}
run: echo "Hyp CLI version must start with `v` && exit 1
- uses: actions/checkout@v4
with:
ref: "${{ github.ref_name }}"
- name: Parse CLI Version
id: parse_cli_version
run: |
echo "cli_version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "npm_tag=$(echo '${{ github.ref_name }}' | sed -E 's/^[^-]+-([a-zA-Z]+).*/\1/ ; s/v.*/latest/')" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.15.0
registry-url: https://registry.npmjs.org
- name: Prepare Release
run: npm version ${{ steps.parse_cli_version.outputs.cli_version }} --no-git-tag-version
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Publish NPM Package
run:
npm publish --provenance --access public --tag ${{ steps.parse_cli_version.outputs.npm_tag
}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(steps.parse_cli_version.outputs.cli_version, '-') }}
make_latest: ${{ contains(steps.parse_cli_version.outputs.cli_version, '-') }}
release-install-script:
needs: release
name: Release Install Script
runs-on: warp-ubuntu-latest-x64-2x
steps:
- uses: actions/checkout@v4
with:
ref: "${{ github.ref_name }}"
- name: Push to R2 Bucket
uses: cloudflare/wrangler-action@v3
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }}
wranglerVersion: 3.83.0
preCommands: |
cat install.sh
command: |
r2 object put install/hyp.sh -f install.sh --content-type text/x-sh