Skip to content

Migrated to GitHub actions #1

Migrated to GitHub actions

Migrated to GitHub actions #1

Workflow file for this run

name: build
on:
push:
branches: [ experimental, develop, main ]
pull_request:
branches: [ develop ]
permissions:
contents: write
id-token: write
env:
NODE_VERSION: 22.12.0
RELEASE_BRANCH: main
PREVIEW_BRANCH: develop
CANARY_BRANCH: experimental
NPM_CONFIG_PROVENANCE: true
jobs:
build:
name: Process Code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
- name: Enable Corepack (Yarn)
run: corepack enable
- name: Install Dependencies
run: yarn install
- name: Build Code
run: yarn build
canary:
name: Canary Packages
needs: build
runs-on: ubuntu-latest
if: github.ref_name == 'experimental'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- name: Enable Corepack
run: corepack enable
- name: Install Dependencies
run: yarn install
- name: Build Code
run: yarn build
- name: Configure Git
run: |
git config --global user.email "releases@piral.io"
git config --global user.name "Piral Release Bot"
- name: Set Build id
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
env:
GITHUB_SHA: ${{ github.sha }}
- name: Canary-Release Packages
run: yarn ci:canary
env:
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
NPM_CONFIG_PROVENANCE: true
prerelease:
name: Preview Packages
needs: build
runs-on: ubuntu-latest
if: github.ref_name == 'develop'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- name: Enable Corepack
run: corepack enable
- name: Install Dependencies
run: yarn install
- name: Build Code
run: yarn build
- name: Configure Git
run: |
git config --global user.email "releases@piral.io"
git config --global user.name "Piral Release Bot"
- name: Set Build id
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
env:
GITHUB_SHA: ${{ github.sha }}
- name: Pre-Release Packages
run: yarn ci:prerelease
env:
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
NPM_CONFIG_PROVENANCE: true
release:
name: Release Packages
needs: build
runs-on: ubuntu-latest
if: github.ref_name == 'main'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Use Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
- name: Enable Corepack
run: corepack enable
- name: Install Dependencies
run: yarn install
- name: Build Code
run: yarn build
- name: Configure Git
run: |
git config --global user.email "releases@piral.io"
git config --global user.name "Piral Release Bot"
- name: Set Build id
run: echo "BUILD_BUILDID=${GITHUB_SHA::7}" >> $GITHUB_ENV
env:
GITHUB_SHA: ${{ github.sha }}
- name: Update Release Date
run: yarn ci:version-update
- name: Release Packages
run: yarn ci:release
env:
NODE_AUTH_TOKEN: "" # explicitly empty to avoid token fallback
NPM_CONFIG_PROVENANCE: true
- name: Update Branches
run: |
git push origin ${RELEASE_BRANCH} --force
git push --tags