Skip to content

⬆️ (deps): Update dependency @types/jest to v30 (#98) #44

⬆️ (deps): Update dependency @types/jest to v30 (#98)

⬆️ (deps): Update dependency @types/jest to v30 (#98) #44

Workflow file for this run

---
name: πŸš€ Release Extension
on:
push:
branches: [main]
paths:
- package.json
workflow_run:
workflows: [πŸš€ Bump Version]
types:
- completed
branches: [main]
permissions:
contents: write
discussions: write
# This workflow can be triggered either by a push to main that changes package.json
# or automatically after the version bump workflow completes successfully
jobs:
check-version:
name: πŸ” Check version change
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
version: ${{ steps.check.outputs.version }}
permissions:
contents: read
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
- name: πŸ” Check for version change
id: check
run: |
# Get current version
CURRENT_VERSION=$(node -p "require('./package.json').version")
echo "Current version: ${CURRENT_VERSION}"
# Get previous version from the previous commit
git checkout HEAD~1
if [ -f "package.json" ]; then
PREVIOUS_VERSION=$(node -p "try { require('./package.json').version } catch { 'none' }")
else
PREVIOUS_VERSION="none"
fi
git checkout -
echo "Previous version: ${PREVIOUS_VERSION}"
# Check if version has changed
if [ "${CURRENT_VERSION}" != "${PREVIOUS_VERSION}" ]; then
echo "Version has changed from ${PREVIOUS_VERSION} to ${CURRENT_VERSION}"
echo "should_release=true" >> "${GITHUB_OUTPUT}"
echo "version=${CURRENT_VERSION}" >> "${GITHUB_OUTPUT}"
else
echo "Version has not changed (${CURRENT_VERSION})"
echo "should_release=false" >> "${GITHUB_OUTPUT}"
echo "version=${CURRENT_VERSION}" >> "${GITHUB_OUTPUT}"
fi
build:
name: πŸ“¦ Build and Release
needs: check-version
if: needs.check-version.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: πŸ—οΈ Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
- name: πŸ“¦ Install PNPM
run: npm install -g pnpm
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ”¨ Build the extension
run: pnpm build:prod && pnpm build:enpack
- name: πŸ“„ Create checksums
run: |
SHA256_FILE="extension-application-map_checksums.txt"
sha256sum ./dist/extension-application-map.tar > "${SHA256_FILE}"
echo "Created checksum file: ${SHA256_FILE}"
cat "${SHA256_FILE}"
- name: πŸš€ Create GitHub Release
run: |
VERSION="v${{ needs.check-version.outputs.version }}"
gh release create "${VERSION}" --draft --generate-notes ./dist/extension-application-map.tar ./extension-application-map_checksums.txt
env:
GH_TOKEN: ${{ github.token }}