Skip to content

Release

Release #12

Workflow file for this run

name:
on:
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Create release branch
run: |
NEW_BRANCH="release/v$(date +%Y%m%d%H%M%S)"
git checkout -b "$NEW_BRANCH"
echo "Created release branch: $NEW_BRANCH"
- name: Generate release
id: release
run: |
NEW_VERSION=$(pnpm release --ci)
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "new_branch=$NEW_BRANCH" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit & push version bump
run: |
git add package.json apps/**/package.json packages/**/package.json
git commit -m "Bump version to v${{ steps.release.outputs.new_version }}"
git push origin ${{ steps.release.outputs.new_branch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build @avelin/app
uses: docker/build-push-action@v6
with:
context: .
file: ./apps/web/Dockerfile
push: true
tags: ghcr.io/avelinapp/web:latest,ghcr.io/avelinapp/web:${{ steps.release.outputs.new_version }},ghcr.io/avelinapp/web:v${{ steps.release.outputs.new_version }}
build-args: NEXT_PUBLIC_APP_URL=https://avelin.app,NEXT_PUBLIC_API_URL=https://api.avelin.app,NEXT_PUBLIC_SYNC_URL=wss://sync.avelin.app
platforms: linux/amd64,linux/arm64