Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 10 additions & 47 deletions .github/workflows/deploy-published-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,13 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: 23
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v4
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: npm ci

- name: Generate types
run: npm run graphql-codegen

- name: Bump version
run: |-
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json

- name: Build package
run: npm run build

- name: Prepare release
run: |-
cp package.json LICENSE README.md build/
cd build

- name: Publish pre-release to NPM
if: ${{ github.event.release.prerelease }}
run: |-
cd build
npm publish --tag next

- name: Publish release to NPM
if: ${{ !github.event.release.prerelease }}
run: |-
cd build
npm publish
uses: croct-tech/github-workflows/.github/workflows/publish-npm-package.yml@unify-workflows
with:
publish-access: "public"
pre-build-script: >-
npm run graphql-codegen &&
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
prepare-script: >-
cp package.json LICENSE README.md build/
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 15 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading