[wip] chore: add publish npm action #27
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: Publish to NPM & Brew | |
on: | |
pull_request: | |
branches: | |
- main | |
- supabase-community:main | |
env: | |
PRERELEASE: "true" | |
jobs: | |
publish: | |
name: Publish All the Things | |
runs-on: ubuntu-latest | |
# todo: add secrets | |
permissions: | |
contents: write | |
# ? what's this?! required for executing the node script? | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
registry-url: "https://registry.npmjs.org" | |
- name: Generate Packages | |
run: node packages/@pglt/pglt/scripts/generate-packages.mjs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_TAG: "0.1.0" | |
PRERELEASE: ${{ env.PRERELEASE }} | |
# TODO: use latest/nightly tag depending on prerelease | |
- name: Publish npm packages as nightly | |
if: env.PRELEASE == 'true' | |
run: | | |
for package in packages/@pglt/*; do | |
npm publish $package --tag nightly --access public --provenance | |
done | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # | |
- name: Publish npm packages as latest | |
if: env.PRELEASE != 'true' | |
run: | | |
for package in packages/@pglt/*; do | |
npm publish $package --tag latest --access public --provenance | |
done | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # |