Skip to content

feat(core): check permissions before serving app #50

feat(core): check permissions before serving app

feat(core): check permissions before serving app #50

Workflow file for this run

name: "Publish @aristid/leav-types @next package to npmjs on push on develop"
on:
push:
branches:
- develop
workflow_dispatch:
secrets:
ARISTID_NPM_TOKEN:
description: 'Npm Token for publishing in aristid organization'
jobs:
install:
uses: ./.github/workflows/install.yml
copy-types:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4
- name: Get cache NPM dependencies
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Generate types
run: yarn workspace core tsc --emitDeclarationOnly --declaration
- name: Create types artifact
uses: actions/upload-artifact@v4
with:
name: libs-types
path: |
./apps/core/dist/*
prepublish:
runs-on: ubuntu-latest
needs: copy-types
outputs:
version: ${{ steps.version.outputs.next_version }}
exists: ${{ steps.check.outputs.exists }}
steps:
- uses: actions/checkout@v4
- name: get next version
id: version
run: |
echo "next_version=$(cat libs/types/package.json | jq -r '.version')-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_OUTPUT"
echo "next_version=$(cat libs/types/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/types/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
# 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/types/package.json
field: version
value: ${{ needs.prepublish.outputs.version }}
- name: Download types artifact
uses: actions/download-artifact@v4
with:
name: libs-types
path: libs/types/
- name: publish next version
run: yarn --cwd "libs/types" install && yarn --cwd "libs/types" publish-types --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.ARISTID_NPM_TOKEN }}