Skip to content

馃敄 v1.11.0 (#536) #1

馃敄 v1.11.0 (#536)

馃敄 v1.11.0 (#536) #1

Workflow file for this run

name: Draft Release
on:
push:
tags: ['v*']
jobs:
draft:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 24
- name: Check tag matches package.json
run: |
expected="v$(jq -r .version package.json)"
if [ "$TAG" != "$expected" ]; then
echo "::error::Tag $TAG doesn't match package.json version ($expected)"
exit 1
fi
if gh release view "$TAG" > /dev/null 2>&1; then
echo "::error::A release for $TAG already exists"
exit 1
fi
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run unit tests
run: bun run test:unit
- name: Build
run: bun run prod
# See build.yml
- name: Cache Blockbench test environment
uses: actions/cache@v4
with:
path: ~/.envbench
key: envbench-${{ runner.os }}-animated-java-tests
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Run tests
timeout-minutes: 20
run: bun run test:only
- name: Create draft release
run: |
# The packager skips the notes when changelog.json has no entry for this version.
if [ ! -f dist/github_release_notes_template ]; then
echo "::error::No release notes were generated. Is there a changelog.json entry for $TAG?"
exit 1
fi
prerelease=$([[ "$TAG" == *-* ]] && echo --prerelease || true)
gh release create "$TAG" --draft --verify-tag $prerelease \
--title "$TAG" \
--notes-file dist/github_release_notes_template \
dist/pluginPackage/animated_java.js \
dist/pluginPackage/about.md \
dist/pluginPackage/changelog.json \
dist/pluginPackage/icon.svg
- name: Preview announcement in test channel
run: bun .scripts/release/announce.ts "${TAG#v}"
env:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
DISCORD_CHANNEL_ID: ${{ vars.DISCORD_TEST_CHANNEL_ID }}
DISCORD_ROLE_PRERELEASE: ${{ vars.DISCORD_ROLE_PRERELEASE }}
DISCORD_ROLE_MINOR: ${{ vars.DISCORD_ROLE_MINOR }}
DISCORD_ROLE_PATCH: ${{ vars.DISCORD_ROLE_PATCH }}
DISCORD_ROLE_BREAKING: ${{ vars.DISCORD_ROLE_BREAKING }}