fix: handle space in user profile path (#696) #28
Workflow file for this run
This file contains 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 CLI | |
on: | |
push: | |
tags: | |
- cli/v* | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
release: | |
name: Release | |
# note: must use GitHub-hosted runner for publishing to NPM with --provenance flag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate version | |
if: ${{ !startsWith(github.ref_name, 'cli/v') }} | |
run: echo "Modus CLI version must start with `cli/v` && exit 1 | |
- uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.ref_name }}" | |
- name: Parse CLI Version | |
id: parse_cli_version | |
run: | | |
echo "cli_version=$(echo '${{ github.ref_name }}' | cut -d'/' -f 2)" >> $GITHUB_OUTPUT | |
echo "npm_tag=$(echo '${{ github.ref_name }}' | cut -d'/' -f 2 | sed -E 's/^[^-]+-([a-zA-Z]+).*/\1/ ; s/v.*/latest/')" >> $GITHUB_OUTPUT | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ">=22" | |
registry-url: https://registry.npmjs.org | |
- name: Prepare Release | |
working-directory: cli | |
run: npm version ${{ steps.parse_cli_version.outputs.cli_version }} --no-git-tag-version | |
- name: Install Dependencies | |
working-directory: cli | |
run: npm ci | |
- name: Build | |
working-directory: cli | |
run: npm run build | |
- name: Publish NPM Package | |
working-directory: cli | |
run: > | |
npm publish --tag ${{ steps.parse_cli_version.outputs.npm_tag }} --access public | |
--provenance | |
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: false | |
release-info: | |
needs: release | |
name: Generate Release Info | |
uses: ./.github/workflows/release-info.yaml | |
secrets: inherit | |
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 | |
workingDirectory: cli | |
preCommands: | | |
cat install.sh | |
command: | | |
r2 object put install/modus.sh -f install.sh --content-type text/x-sh |