Skip to content

Update

Update #661

Workflow file for this run

#
# DO NOT EDIT!
# This file was autogenerated by Carson.
# Changes may cause incorrect behavior and will be lost when the file is regenerated.
#
# Run `npx carson update workspace` to regenerate.
#
name: Release
on: [push, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release_main_branch:
name: Release
if: ${{ github.ref_name == 'main' }}
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- name: Configure git
run: |
git config user.email "bot@mazanec.dev"
git config user.name "Bot"
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: edgedb/setup-edgedb@v1
with:
server-version: none
- name: Install packages
run: npm ci
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Migrate "dram"
run: |
edgedb migrate --schema-dir apps/dram/dbschema
env:
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
- name: Test
run: npm test -- --filter=!dram
- name: Test "dram"
run: |
npm run test -- --filter=dram
env:
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Build packages
run: npm run build -- --filter=!dram --filter=!somewhere
- name: Authenticate to npm registry
run: |
echo "//registry.npmjs.com/:_authToken=NPM_TOKEN" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Version packages
run: |
npx changeset version
git status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
run: |
git add -A
git reset .npmrc
git status
git commit -m"Release [skip actions]"
- name: Publish packages
run: |
npx changeset publish --no-git-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
- name: Update lockfile
run: |
npm install
git add package-lock.json
git status
git commit --amend --no-edit
- name: Update Carson
run: |
git add **/.carson/*.snapshot
git status
git commit --amend --no-edit
- name: Add git tags
run: |
npx changeset tag
- name: Push changes
run: |
git push --follow-tags
- name: Checkout development branch
run: |
git fetch -p origin
git checkout -B development
git branch --set-upstream-to=origin/development development
git reset --hard origin/development
- name: Merge and commit
run: |
git merge main --no-verify
git push -u origin development --no-verify
- name: Checkout main branch
run: |
git checkout -B main
git branch --set-upstream-to=origin/main main
git reset --hard origin/main
git pull
- name: Deploy "dram"
run: |
npm run deploy --workspace dram -- --build-arg "VITE_APP_URL=$VITE_APP_URL" --build-arg "EDGEDB_INSTANCE=$EDGEDB_INSTANCE" --build-arg "EDGEDB_BRANCH=$EDGEDB_BRANCH" --build-secret "EDGEDB_SECRET_KEY=$EDGEDB_SECRET_KEY"
env:
VITE_APP_URL: https://dram.mazanec.dev
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
- name: Deploy "somewhere"
run: |
npm run deploy --workspace somewhere -- --build-arg "VITE_APP_URL=$VITE_APP_URL"
env:
VITE_APP_URL: https://somewhere.fly.dev
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
release_development_branch:
name: Release preview
if: ${{ github.ref_name == 'development' }}
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- name: Configure git
run: |
git config user.email "bot@mazanec.dev"
git config user.name "Bot"
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: edgedb/setup-edgedb@v1
with:
server-version: none
- name: Install packages
run: npm ci
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Migrate "dram"
run: |
edgedb migrate --schema-dir apps/dram/dbschema
env:
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
- name: Test
run: npm test -- --filter=!dram
- name: Test "dram"
run: |
npm run test -- --filter=dram
env:
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
- name: Check for changes
run: |
git config core.filemode false
git_status=$(git status --porcelain)
if [[ -n $git_status ]]; then
echo "You have uncommitted changes!"
git diff
git config --unset core.filemode
exit 1
fi
git config --unset core.filemode
- name: Build packages
run: npm run build -- --filter=!dram --filter=!somewhere
- name: Update documentation
run: |
npm run document --if-present
npm run format --if-present
git add **/docs/**
git status
git commit -m"Update docs [skip actions]"
git push --force
continue-on-error: true
- name: Authenticate to npm registry
run: |
echo "//registry.npmjs.com/:_authToken=NPM_TOKEN" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Version packages
run: |
npx changeset version --snapshot next.$(git rev-parse --short HEAD) --snapshot-prerelease-template "{tag}"
git status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish packages
run: |
npx changeset publish --tag next --no-git-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true' # must be string, not boolean
- name: Deploy "dram"
run: |
npm run deploy --workspace dram -- --app dram-next --build-arg "VITE_APP_URL=$VITE_APP_URL" --build-arg "EDGEDB_INSTANCE=$EDGEDB_INSTANCE" --build-arg "EDGEDB_BRANCH=$EDGEDB_BRANCH" --build-secret "EDGEDB_SECRET_KEY=$EDGEDB_SECRET_KEY"
env:
VITE_APP_URL: https://dram-next.fly.dev
EDGEDB_INSTANCE: jakubmazanec/whisky
EDGEDB_BRANCH: ${{ github.ref_name }}
EDGEDB_SECRET_KEY: ${{ secrets.JAKUBMAZANEC_WHISKY_EDGEDB_TOKEN }}
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}
- name: Deploy "somewhere"
run: |
npm run deploy --workspace somewhere -- --app somewhere-next --build-arg "VITE_APP_URL=$VITE_APP_URL"
env:
VITE_APP_URL: https://somewhere-next.fly.dev
FLY_ACCESS_TOKEN: ${{ secrets.FLY_TOKEN }}
FLY_API_TOKEN: ${{ secrets.FLY_TOKEN }}