diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml new file mode 100644 index 0000000..378f958 --- /dev/null +++ b/.github/workflows/publish-github.yml @@ -0,0 +1,34 @@ +name: Publish UI package to GitHub registry + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish-github: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + cache: yarn + + - name: Install dependencies + run: yarn install + + - name: Build package + run: yarn build + + - name: Publish to NPM + run: npm publish --scope=@internxt --registry=https://npm.pkg.github.com --tag latest + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 2b95ad0..930a9c7 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,15 +1,17 @@ -name: Publish UI Package to npmjs +name: Publish UI package to NPM registry + on: release: types: [published] workflow_dispatch: + jobs: - publish-ui: + publish-npm: runs-on: ubuntu-latest permissions: contents: read - id-token: write packages: write + steps: - name: Checkout code uses: actions/checkout@v4 @@ -26,12 +28,7 @@ jobs: - name: Build package run: yarn build - - name: Configure NPM registry - run: | - echo "registry=https://registry.npmjs.org/" > .npmrc - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc - - name: Publish to NPM - run: npm publish --scope=@internxt --access public + run: npm publish --scope=@internxt --registry=https://registry.npmjs.org/ --access public --tag latest env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 3153004..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Publish the UI package in GitHub package registry -on: - release: - types: [created] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v4 - with: - node-version: '18.x' - registry-url: 'https://npm.pkg.github.com' - - run: | - echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc - echo "//npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }}" >> .npmrc - # Install all necessary dependencies - - run: yarn - env: - NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - # Build and publish the project - - run: yarn build - - run: yarn publish - env: - NODE_AUTH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b958a35..3e57a1d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,25 +9,21 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] + steps: - - name: Checkout + - name: Checkout code uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} - - - run: | - echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc - echo "//npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }}" >> .npmrc + node-version: '22.x' + cache: yarn - name: Install dependencies - run: yarn + run: yarn install - - name: Build the project + - name: Build package run: yarn build - name: Run Tests