Release (#295) #159
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: Release | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
MAIN_MENU_LINKS: ${{ vars.MAIN_MENU_LINKS }} | |
on: | |
push: | |
branches: [release] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Global Dependencies | |
run: pnpm add -g vercel | |
# - run: pnpm install | |
# - run: pnpm build | |
- run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- run: node scripts/replaceFavicon.mjs ${{ secrets.FAVICON_MAIN }} | |
# will install + build to .vercel/output/static | |
- name: Get Release Info | |
run: pnpx zardoy-release empty --skip-github --output-file assets/release.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --prod | |
env: | |
CONFIG_JSON_SOURCE: BUNDLED | |
- run: pnpm build-storybook | |
- name: Copy playground files | |
run: | | |
mkdir -p .vercel/output/static/playground | |
pnpm build-playground | |
cp -r renderer/dist/* .vercel/output/static/playground/ | |
- name: Download Generated Sounds map | |
run: node scripts/downloadSoundsMap.mjs | |
- name: Deploy Project to Vercel | |
uses: mathiasvr/[email protected] | |
with: | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod | |
id: deploy | |
# publish to github | |
- run: cp vercel.json .vercel/output/static/vercel.json | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: .vercel/output/static | |
force_orphan: true | |
- name: Build self-host version | |
run: pnpm build | |
- name: Bundle server.js | |
run: | | |
pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define:process.env.NODE_ENV="'production'" | |
- name: Create zip package | |
run: | | |
mkdir -p package | |
cp -r dist package/ | |
cp bundled-server.js package/server.js | |
cd package | |
zip -r ../self-host.zip . | |
- run: | | |
pnpx zardoy-release node --footer "This release URL: ${{ steps.deploy.outputs.stdout }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# has possible output: tag | |
id: release | |
# has output | |
- name: Set publishing config | |
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# - run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }} | |
# if: steps.release.outputs.tag | |
# env: | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |