Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Aug 29, 2024
1 parent e0f9dd8 commit 5640fe1
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,57 @@ name: Release Node.js SDK
run-name: Release Node.js SDK

on:
push:
tags:
- "*.*.*" # version, e.g. 1.0.0
push:
tags:
- "*.*.*" # version, e.g. 1.0.0

jobs:
npm:
name: Publish NPM
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Set NPM version
run: npm version ${{ github.ref_name }} --allow-same-version --no-git-tag-version

- name: Build API client
run: npm run generate-api:infisical

- name: Build SDK
run: npm run build

- name: Setup NPM
run: |
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc
echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Pack NPM
run: npm pack

- name: Publish NPM
run: npm publish --tarball=./infisical-sdk-v2-${{github.ref_name}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish NPM
run: npm publish --dry-run --access public --registry=https://registry.npmjs.org/ # todo: remove dry run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
npm:
name: Publish NPM
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
cache: "npm"
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm install

- name: Set NPM version
run: npm version ${{ github.ref_name }} --allow-same-version --no-git-tag-version

- name: Build API client
run: npm run generate-api:infisical

- name: Build SDK
run: npm run build

- name: Setup NPM
run: |
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc
echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Pack NPM
run: npm pack

- name: Publish NPM
run: npm publish --tarball=./infisical-sdk-v2-${{github.ref_name}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish NPM
run: npm publish --dry-run --access public --registry=https://registry.npmjs.org/ # todo: remove dry run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 5640fe1

Please sign in to comment.