Archived
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
name: actions
|
|
'on':
|
|
push:
|
|
tags:
|
|
- v*.*.*
|
|
jobs:
|
|
pkg:
|
|
runs-on: apex-debian13
|
|
strategy:
|
|
matrix:
|
|
node-version:
|
|
- 18.x
|
|
pnpm-version:
|
|
- 8
|
|
steps:
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v4
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
run: |
|
|
case "$NODE_VERSION" in
|
|
18*) major=18;; 20*) major=20;; 22*) major=22;; *) exit 1;;
|
|
esac
|
|
test -x "/opt/ci/node/$major/bin/node"
|
|
echo "/opt/ci/node/$major/bin" >> "$GITHUB_PATH"
|
|
env:
|
|
NODE_VERSION: ${{ matrix.node-version }}
|
|
- name: Install PKG
|
|
run: |
|
|
test -x /opt/ci/pkg/bin/pkg
|
|
echo /opt/ci/pkg/bin >> "$GITHUB_PATH"
|
|
- name: Install dependencies
|
|
run: npm install
|
|
- name: ESLint & Prettier
|
|
run: npm run lint
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Test
|
|
run: npm run --if-present test
|
|
- name: Package
|
|
run: pkg --out-path ./artifacts ./dist/index.js
|
|
- name: Naming
|
|
run: |
|
|
for f in ./artifacts/index*; do
|
|
mv -i -- "$f" "${f//index/styleforces}"
|
|
done
|
|
- name: Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
run: python3 .gitea/scripts/release.py
|
|
env:
|
|
RELEASE_TOKEN: ${{ github.token }}
|
|
env:
|
|
PKG_CACHE_PATH: /opt/ci/pkg-cache
|
|
permissions:
|
|
contents: write
|