-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #438 from leav-solutions/chore/publish-ui-next
ci(@leav/ui): publish next version on push on develop
- Loading branch information
Showing
4 changed files
with
98 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "install dependencies" | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
- name: Install dependency | ||
run: sudo apt-get update && sudo apt-get install -y libpoppler-dev libpoppler-cpp-dev libpoppler-private-dev poppler-utils | ||
- name: install node module | ||
run: yarn install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: "Publish @leav/ui @next package to npmjs on push on develop" | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- libs/ui/** | ||
workflow_dispatch: | ||
secrets: | ||
NPM_TOKEN: | ||
description: 'Npm Token' | ||
required: true | ||
|
||
jobs: | ||
install: | ||
uses: ./.github/workflows/install.yml | ||
prepublish: | ||
runs-on: ubuntu-latest | ||
needs: install | ||
outputs: | ||
version: ${{ steps.version.outputs.next_version }} | ||
exists: ${{ steps.check.outputs.exists }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: 'develop' | ||
- name: get next version | ||
id: version | ||
run: | | ||
echo "next_version=$(cat libs/ui/package.json | jq -r '.version')-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_OUTPUT" | ||
echo "next_version=$(cat libs/ui/package.json | jq -r '.version')-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | ||
- name: Update package.json version | ||
uses: jossef/[email protected] | ||
with: | ||
file: libs/ui/package.json | ||
field: version | ||
value: ${{ env.next_version }} | ||
- name: Check publish status | ||
id: check_npm | ||
uses: tehpsalmist/npm-publish-status-action@v1 | ||
- name: set check npm variable | ||
id: check | ||
run: | | ||
echo "exists=${{ steps.check_npm.outputs.exists }}" >> "$GITHUB_OUTPUT" | ||
publish-next: | ||
runs-on: ubuntu-latest | ||
needs: prepublish | ||
if: ${{needs.prepublish.outputs.exists == '0'}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: 'develop' | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Update package.json version | ||
uses: jossef/[email protected] | ||
with: | ||
file: libs/ui/package.json | ||
field: version | ||
value: ${{ needs.prepublish.outputs.version }} | ||
- name: Cache NPM dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
- run: sudo apt-get update && sudo apt-get install -y libpoppler-dev libpoppler-cpp-dev libpoppler-private-dev poppler-utils | ||
- name: build project | ||
run: yarn --cwd "libs/ui" build | ||
- name: publish next version | ||
run: yarn --cwd "libs/ui" publish-ui --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters