Skip to content

testing with workflows from my test branch #58

testing with workflows from my test branch

testing with workflows from my test branch #58

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to simulate (e.g. v1.0.0)"
required: false
type: string
push:
# Avoid duplicate builds on PRs.
branches:
- bj-package
tags:
- "*"
pull_request:
branches:
- bj-package
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
version: [22, 20, 18]
os:
[sfdc-hk-ubuntu-latest, sfdc-hk-macos-latest, sfdc-hk-windows-latest]
name: Node ${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4 # java required for testing with wiremock
with:
java-package: jre
java-version: "11"
distribution: "zulu"
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: "npm"
- name: Simulate tag push
if: github.event.inputs.tag != ''
run: |
echo "GITHUB_REF=refs/tags/${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- run: npm install
- run: npm run format:check
- run: npm run lint
- run: npm run test
- run: npm run build
- name: Pack package
if: github.ref == 'refs/heads/bj-package' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != ''
id: pack
run: |
PACKAGE_NAME=$(npm pack)
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload package
if: github.ref == 'refs/heads/bj-package' || startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != ''
uses: actions/upload-artifact@v4
with:
name: package
path: ${{ steps.pack.outputs.package_name }}
if-no-files-found: error