Skip to content

fix: set js emit to true in ts build config (2.2.3) #613

fix: set js emit to true in ts build config (2.2.3)

fix: set js emit to true in ts build config (2.2.3) #613

Workflow file for this run

name: CI
on:
push:
branches:
- master
- develop
- beta
- next
tags-ignore:
- '**'
paths-ignore:
- '**/CHANGELOG.md'
- '**/package.json'
pull_request:
workflow_dispatch:
permissions:
contents: read
packages: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Cache node modules
uses: actions/cache@v5
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install deps
run: npm ci --audit=false
- name: Lint ESLint
run: npm run lint:eslint
- name: Lint Prettier
run: npm run lint:prettier
test:
strategy:
fail-fast: false
matrix:
suite: [admin, api, stacks-core, token-queue]
runs-on: ubuntu-latest
env:
API_HOST: 127.0.0.1
API_PORT: 3000
PROMETHEUS_PORT: 9153
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
STACKS_NODE_RPC_HOST: 127.0.0.1
STACKS_NODE_RPC_PORT: 24440
SNP_REDIS_URL: redis://localhost:6379
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Cache node modules
uses: actions/cache@v5
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install deps
run: npm ci --audit=false
- name: Run tests
run: npx c8 --reporter=lcov npm run test:${{ matrix.suite }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
version:
runs-on: ubuntu-latest
needs: [lint, test]
outputs:
next_version: ${{ steps.calc.outputs.next_version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
- name: Install version tools
run: npm install -g conventional-recommended-bump conventional-changelog-conventionalcommits semver
- name: Calculate next version
id: calc
run: |
BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
LATEST_VERSION=${LATEST_TAG#v}
if [ "$BRANCH" = "master" ]; then
BUMP=$(npx conventional-recommended-bump -p conventionalcommits)
NEXT_VERSION=$(npx semver "$LATEST_VERSION" -i "$BUMP")
elif [ "$BRANCH" = "alpha" ] || [ "$BRANCH" = "beta" ]; then
CHANNEL="$BRANCH"
if echo "$LATEST_VERSION" | grep -qE "\-${CHANNEL}\.[0-9]+$"; then
NEXT_VERSION=$(npx semver "$LATEST_VERSION" -i prerelease --preid "$CHANNEL")
else
BUMP=$(npx conventional-recommended-bump -p conventionalcommits)
BASE=$(npx semver "$LATEST_VERSION" -i "$BUMP")
NEXT_VERSION="${BASE}-${CHANNEL}.0"
fi
else
echo "Skipping version calculation for branch '$BRANCH'"
echo "next_version=" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "next_version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
echo "## Next Version: \`$NEXT_VERSION\`" >> "$GITHUB_STEP_SUMMARY"
echo "Based on branch \`$BRANCH\`, latest tag \`$LATEST_TAG\`" >> "$GITHUB_STEP_SUMMARY"
build-publish:
runs-on: ubuntu-latest
needs: [lint, test]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Docker Meta
id: docker_meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build/Tag/Push Image
id: docker_push
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
# Only push on non-PR events, or PRs that aren't from forks
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}