Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22'

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.4.1

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run build
run: pnpm build

- name: Create tarball
run: |
tar -czf excalidraw.tar.gz dist/

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Generate changelog and bump version
id: version
run: |
changelogen --bump --output CHANGELOG.md

NEW_VERSION="v$(node -p "require('./package.json').version")"
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Commit changes
run: |
git add package.json CHANGELOG.md
git commit -m "chore(release): ${{ steps.version.outputs.new_version }}"

- name: Create tag
run: git tag ${{ steps.version.outputs.new_version }}

- name: Push changes
run: |
git push origin main
git push origin ${{ steps.version.outputs.new_version }}

- name: Extract changelog for release
id: changelog
run: |
CHANGELOG=$(awk '/^## /{if(++count==2) exit} count==1' CHANGELOG.md | sed '1d')
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.new_version }}
name: Release ${{ steps.version.outputs.new_version }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
files: excalidraw.tar.gz
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
pnpm-lock.yaml
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@types/react-dom": "^19.2.1",
"@vitejs/plugin-react": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^5.1.1",
"changelogen": "^0.6.2",
"eslint": "^9.37.0",
"eslint-plugin-vue": "^10.5.0",
"globals": "^16.4.0",
Expand Down
Loading