Skip to content

Commit

Permalink
chore: add step to publish flight-sql-client packages
Browse files Browse the repository at this point in the history
this currently runs based on commit message which will not cause anything to run, however, until we set up a real NPM_TOKEN and decide how we want to release, this won't be able to publish
  • Loading branch information
dav1do committed Nov 19, 2024
1 parent 1f50cd9 commit 1be0d89
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,66 @@ jobs:
shell: bash
- name: Test bindings
working-directory: ${{ env.FLIGHT_SQL_PATH }}
run: pnpm test
run: pnpm test
publish:
name: Publish flight-sql-client
runs-on: ubuntu-latest
needs:
- test-linux-x64-gnu-binding
- test-macOS-binding
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
id: pnpm-install
uses: pnpm/action-setup@v3
with:
version: 9.8.0
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}_publish-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}_publish-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ${{ env.FLIGHT_SQL_PATH }}
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.FLIGHT_SQL_PATH }}/artifacts
- name: Move artifacts
run: pnpm artifacts
working-directory: ${{ env.FLIGHT_SQL_PATH }}
- name: List packages
run: ls -R ./npm
shell: bash
working-directory: ${{ env.FLIGHT_SQL_PATH }}
- name: Publish
working-directory: ${{ env.FLIGHT_SQL_PATH }}
run: |
npm config set provenance true
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --tag next --access public
else
echo "Not a release, skipping publish"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 1be0d89

Please sign in to comment.