Skip to content

Merge pull request #441 from ladesa-ro/dependabot/npm_and_yarn/dev-de… #143

Merge pull request #441 from ladesa-ro/dependabot/npm_and_yarn/dev-de…

Merge pull request #441 from ladesa-ro/dependabot/npm_and_yarn/dev-de… #143

Workflow file for this run

name: Release
on:
push:
branches:
- development
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
published-packages: ${{ steps.changesets.outputs.publishedPackages }}
publish-npm: ${{ steps.changesets.outputs.published }}
permissions:
pages: read
issues: write
actions: write
statuses: write
contents: write
pull-requests: write
security-events: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./.github/actions/prepare/install
with:
install-node: "true"
- name: Run changesets action
uses: changesets/action@v1
id: changesets
with:
# setupGitUser: false
setupGitUser: true
createGithubReleases: false
title: "chore: version packages"
commit: "chore: version packages"
publish: pnpm run -w changeset:tag
version: pnpm run -w changeset:version
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_outputs:
name: Show the release job outputs
runs-on: ubuntu-latest
needs: [release]
steps:
- name: print outputs (for debug purposes only)
run: echo '${{ toJSON(needs.release.outputs) }}'
ci_npm:
name: Publish to the NPM registry
runs-on: ubuntu-latest
needs: [release]
if: needs.release.outputs.published == 'true' && needs.release.outputs.publish-npm == 'true'
permissions:
actions: read
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract tag
id: extract-tag
run: |
TAG=latest
FILE=.changeset/pre.json
if [ -f ${FILE} ]; then
TAG=$(cat ${FILE} | jq .tag);
fi
echo tag: ${TAG}
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Publish to the NPM registry
uses: ./.github/actions/publish/npm
with:
tag: "${{ steps.extract-tag.outputs.tag }}"
npm-token: "${{ secrets.NPM_TOKEN }}"
ci_npm_edge:
name: Edge NPM package publish
runs-on: ubuntu-latest
needs: [release]
if: needs.release.outputs.published == 'false'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install
uses: ./.github/actions/prepare/install
with:
install-node: "true"
- name: Build
uses: ./.github/actions/prepare/build
with:
workspace-build: "true"
- name: "Continuos Release: publish to pkg.pr.new"
run: pnpx pkg-pr-new publish --comment=update './integrations/npm/api-client-fetch'