Skip to content

Bumping common library version #26

Bumping common library version

Bumping common library version #26

name: Publish common lib
on:
workflow_dispatch:
push:
branches: ['UE5.5']
paths: ['Common/package.json']
env:
NODE_VERSION: 18.17.x
jobs:
build:
if: github.repository == 'EpicGamesExt/PixelStreamingInfrastructure'
runs-on: ubuntu-latest
defaults:
run:
working-directory: Common
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: 'Common'
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE_VERSION }}"
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- id: get-package-json
run: |
package_content=`cat package.json`
echo "json<<EOF" >> $GITHUB_OUTPUT
echo $package_content >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- shell: bash
id: extract_branch
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/lib-common-${{ steps.extract_branch.outputs.branch }}-${{ fromJson(steps.get-package-json.outputs.json).version }}',
sha: context.sha
})