Skip to content

Update

Update #7

Workflow file for this run

name: Release
permissions: read-all
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24
registry-url: 'https://npm.pkg.github.com'
- name: Install dependencies
run: npm install
# TODO
#- name: Test
# run: npm test
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
- name: Build artifact
run: npm run build
- name: Build versioned and latest release copies
run: bash release.sh
- name: Install Wrangler
run: npm install -g wrangler
- name: Upload to Cloudflare R2
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: |
wrangler r2 object put ${{ vars.CLOUDFLARE_R2_BUCKET_NAME }}/phaset_api_${VERSION}.zip --file=phaset_api_${VERSION}.zip --jurisdiction=eu --remote
wrangler r2 object put ${{ vars.CLOUDFLARE_R2_BUCKET_NAME }}/phaset_api_latest.zip --file=phaset_api_latest.zip --jurisdiction=eu --remote
- name: Notify backoffice API
env:
VERSION: ${{ steps.version.outputs.version }}
run: |
curl -X POST https://api.phaset.dev/version/api?version=${VERSION} -H "Authorization: ${{ secrets.PHASET_BACKOFFICE_API_KEY }}"