Skip to content

Commit

Permalink
ADCIO-4504) add cds tag publish workflow (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
lebmouse authored Jul 15, 2024
1 parent b0a2172 commit 25f44be
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/package-tag-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CDS Tag Publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: pnpm/action-setup@v3
with:
version: 8

- uses: actions/cache@v3
id: pnpm-cache
with:
path: node_modules
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- if: steps.pnpm-cache.outputs.cache-hit != 'true'
run: pnpm install --no-frozen-lockfile

- run: pnpm run build

- name: Get SLUG and SHA
id: tag-meta
run: |
BRANCH_SLUG=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/\//-/g')
SHORT_SHA=$(echo "${GITHUB_SHA::6}")
echo "BRANCH_SLUG=${BRANCH_SLUG}" >> $GITHUB_OUTPUT
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_OUTPUT
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
tag: ${{ steps.tag-meta.outputs.BRANCH_SLUG }}-${{ steps.tag-meta.outputs.SHORT_SHA }}

0 comments on commit 25f44be

Please sign in to comment.