Skip to content

Merge pull request #257 from aspen-cloud/changeset-release/main #546

Merge pull request #257 from aspen-cloud/changeset-release/main

Merge pull request #257 from aspen-cloud/changeset-release/main #546

Workflow file for this run

name: Publish
on:
push:
branches:
- 'main'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish-npm:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'yarn'
- name: Setup .yarnrc.yml
run: |
yarn config set npmAuthToken $NPM_TOKEN
yarn config set npmAlwaysAuth true
env:
NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
- name: Install
run: yarn install --immutable
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
version: yarn run version
publish: yarn run release:packages
env:
NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
publish-docker:
needs: publish-npm
runs-on: ubuntu-latest
# TODO: only run if publish was made to @triplit/server
if: needs.publish-npm.outputs.published == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Install Node server dependencies
run: cd packages/node-server && yarn workspaces focus
- name: Build and push Node server Docker image
run: cd packages/node-server && PROJECTS_ADMIN_API_URL=${{secrets.PROJECTS_ADMIN_API_URL}} PROJECTS_ADMIN_API_KEY=${{secrets.PROJECTS_ADMIN_API_KEY}} yarn check-and-publish
- name: Install Bun server dependencies
run: cd packages/bun-server && yarn workspaces focus
- name: Build and push Bun server Docker image
run: cd packages/bun-server && PROJECTS_ADMIN_API_URL=${{secrets.PROJECTS_ADMIN_API_URL}} PROJECTS_ADMIN_API_KEY=${{secrets.PROJECTS_ADMIN_API_KEY}} yarn check-and-publish