Bump version #4
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: "📦 Publish create-react-native-airborne" | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| - "create-react-native-airborne@*" | |
| jobs: | |
| publish: | |
| name: "🚀 Publish to npm + GitHub Release" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: "📥 Checkout" | |
| uses: actions/checkout@v4 | |
| - name: "🥟 Setup Bun" | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.4" | |
| - name: "🟢 Setup Node" | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: "🧰 Ensure npm supports trusted publishing" | |
| run: | | |
| npm install -g npm@latest | |
| node --version | |
| npm --version | |
| - name: "📦 Install dependencies" | |
| run: bun install --workspaces | |
| - name: "🧾 Validate tag matches package version" | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| package_version="$(node -p "require('./tooling/create-react-native-airborne/package.json').version")" | |
| if [[ "${tag}" == create-react-native-airborne@* ]]; then | |
| expected="${tag#create-react-native-airborne@}" | |
| elif [[ "${tag}" == v* ]]; then | |
| expected="${tag#v}" | |
| else | |
| echo "Unsupported tag format: ${tag}" | |
| exit 1 | |
| fi | |
| if [[ "${expected}" != "${package_version}" ]]; then | |
| echo "Tag version (${expected}) does not match package version (${package_version})." | |
| exit 1 | |
| fi | |
| - name: "🚢 Publish package" | |
| working-directory: tooling/create-react-native-airborne | |
| run: npm publish --access public --provenance | |
| - name: "🏷️ Create GitHub Release" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| tag="${GITHUB_REF_NAME}" | |
| if gh release view "${tag}" >/dev/null 2>&1; then | |
| echo "Release ${tag} already exists; skipping." | |
| exit 0 | |
| fi | |
| gh release create "${tag}" \ | |
| --title "${tag}" \ | |
| --generate-notes |