Skip to content

Merge pull request #12 from SpawnDock/codex/dev-tunnel-fix-cli-entryp… #22

Merge pull request #12 from SpawnDock/codex/dev-tunnel-fix-cli-entryp…

Merge pull request #12 from SpawnDock/codex/dev-tunnel-fix-cli-entryp… #22

Workflow file for this run

name: Publish @spawn-dock/dev-tunnel
on:
push:
tags:
- "v*"
branches:
- main
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
check:
uses: ./.github/workflows/check.yml
publish:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.12.0
registry-url: https://registry.npmjs.org
- run: npm ci
- name: Determine version type
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "type=release" >> "$GITHUB_OUTPUT"
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
else
SHORT_SHA="${GITHUB_SHA::7}"
TIMESTAMP="$(date +%Y%m%d%H%M%S)"
CURRENT=$(node -p "require('./package.json').version")
CANARY="${CURRENT}-canary.${TIMESTAMP}.${SHORT_SHA}"
echo "type=canary" >> "$GITHUB_OUTPUT"
echo "version=$CANARY" >> "$GITHUB_OUTPUT"
fi
- name: Set package version
run: npm version "${{ steps.version.outputs.version }}" --no-git-tag-version --allow-same-version
- run: npm run build
- name: Publish release
if: steps.version.outputs.type == 'release'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
- name: Publish canary
if: steps.version.outputs.type == 'canary'
run: npm publish --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}