Skip to content

Commit

Permalink
DOPS-944 Publish to NPMJS
Browse files Browse the repository at this point in the history
  • Loading branch information
dm3ch committed Mar 4, 2024
1 parent c328ca9 commit 7e35229
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,53 @@ jobs:
contents: read
packages: write
steps:






publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: ${{ github.repository_owner }}

- name: Update package.json
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//}
PACKAGE_VERSION=${TAG_NAME#v}
echo "Updating package.json to version $PACKAGE_VERSION"
cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json
cat <<< $(jq -r ".name=\"@${{ github.repository }}\"" package.json) > package.json
cat package.json
# - name: Install dependencies
# run: yarn install --frozen-lockfile

# - name: Build
# run: yarn build

- name: Publish
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-to-github:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down

0 comments on commit 7e35229

Please sign in to comment.