Skip to content

Merge branch 'main' into dev #297

Merge branch 'main' into dev

Merge branch 'main' into dev #297

---
name: Pre-Release Drafter
on:
push:
branches:
- dev
workflow_dispatch:
permissions:
contents: read
jobs:
build_artifact:
name: Build card and store artifact
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: dev
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Prepare dependencies
run: |
echo "Get Node version"
node --version
echo "Install Yarn"
npm install -g [email protected]
echo "Check that we're running latest yarn..."
which yarn
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}
${{ runner.OS }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Set version in release, repo based on tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
npm version prerelease -m "beep boop version bump"
git push
- name: Build the project
run: |
yarn rollup
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: card-js
path: dist/mass-player-card.js
- name: Upload package.json
uses: actions/upload-artifact@v4
with:
name: package-json
path: package.json
draft_prerelease:
name: Draft pre-release
runs-on: ubuntu-latest
needs: build_artifact
permissions:
contents: write
pull-requests: write
steps:
- name: Grab built card
uses: actions/download-artifact@v5
with:
name: card-js
- name: Grab package.json
uses: actions/download-artifact@v5
with:
name: package-json
- name: Get Version
id: version
run: |
echo "pkg_version=$(jq -r '.version' package.json)" >> "${GITHUB_OUTPUT}"
- name: Run Release Drafter
uses: release-drafter/[email protected]
with:
config-name: release-drafter-dev.yml
prerelease: true
prerelease-identifier: b
tag: v${{ steps.version.outputs.pkg_version }}
version: v${{ steps.version.outputs.pkg_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload built source
uses: softprops/action-gh-release@v2
with:
files: mass-player-card.js
tag_name: v${{ steps.version.outputs.pkg_version }}
draft: true
prerelease: true
target_commitish: dev