Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Split publish of db migrator and types to keep steps separate and add oidc support to remove need for npm token. (#89)

authored by

Juan Mrad and committed by
GitHub
1d13ace7 1d9afe3c

+84 -62
+42
.github/workflows/publish-db-migrator.yaml
··· 1 + name: Publish Packages 2 + 3 + on: 4 + push: 5 + branches: [main] 6 + paths: 7 + - 'migrator/**' 8 + workflow_dispatch: 9 + 10 + permissions: 11 + id-token: write # Required for OIDC i.e. publish package 12 + contents: read 13 + 14 + jobs: 15 + publish: 16 + runs-on: ubuntu-latest 17 + steps: 18 + - name: Checkout code 19 + uses: actions/checkout@v4 20 + 21 + - name: Setup Node.js 22 + uses: actions/setup-node@v6 23 + with: 24 + node-version-file: '.nvmrc' 25 + check-latest: true 26 + registry-url: 'https://registry.npmjs.org' 27 + cache: 'npm' 28 + 29 + - name: Check and publish migrator 30 + run: | 31 + cd migrator 32 + VERSION=$(node -p "require('./package.json').version") 33 + echo "Checking @roostorg/db-migrator@$VERSION..." 34 + 35 + if npm view "@roostorg/db-migrator@$VERSION" version >/dev/null 2>&1; then 36 + echo "⚠️ Version $VERSION of @roostorg/db-migrator already exists on npm - skipping" 37 + else 38 + echo "✅ Publishing @roostorg/db-migrator@$VERSION..." 39 + npm ci 40 + npm run build 41 + npm publish 42 + fi
-62
.github/workflows/publish-packages.yaml
··· 1 - name: Publish Packages 2 - 3 - on: 4 - push: 5 - branches: [main] 6 - paths: 7 - - 'migrator/**' 8 - - 'types/**' 9 - workflow_dispatch: 10 - 11 - jobs: 12 - publish: 13 - runs-on: ubuntu-latest 14 - permissions: 15 - contents: read 16 - packages: write 17 - 18 - steps: 19 - - name: Checkout code 20 - uses: actions/checkout@v4 21 - 22 - - name: Setup Node.js 23 - uses: actions/setup-node@v6 24 - with: 25 - node-version-file: '.nvmrc' 26 - check-latest: true 27 - registry-url: 'https://registry.npmjs.org' 28 - cache: 'npm' 29 - 30 - - name: Check and publish migrator 31 - run: | 32 - cd migrator 33 - VERSION=$(node -p "require('./package.json').version") 34 - echo "Checking @roostorg/db-migrator@$VERSION..." 35 - 36 - if npm view "@roostorg/db-migrator@$VERSION" version >/dev/null 2>&1; then 37 - echo "⚠️ Version $VERSION of @roostorg/db-migrator already exists on npm - skipping" 38 - else 39 - echo "✅ Publishing @roostorg/db-migrator@$VERSION..." 40 - npm ci 41 - npm run build 42 - npm publish 43 - fi 44 - env: 45 - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 46 - 47 - - name: Check and publish types 48 - run: | 49 - cd types 50 - VERSION=$(node -p "require('./package.json').version") 51 - echo "Checking @roostorg/types@$VERSION..." 52 - 53 - if npm view "@roostorg/types@$VERSION" version >/dev/null 2>&1; then 54 - echo "⚠️ Version $VERSION of @roostorg/types already exists on npm - skipping" 55 - else 56 - echo "✅ Publishing @roostorg/types@$VERSION..." 57 - npm ci 58 - npm run build 59 - npm publish 60 - fi 61 - env: 62 - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+42
.github/workflows/publish-types.yaml
··· 1 + name: Publish Packages 2 + 3 + on: 4 + push: 5 + branches: [main] 6 + paths: 7 + - 'types/**' 8 + workflow_dispatch: 9 + 10 + permissions: 11 + id-token: write # Required for OIDC i.e. publish package 12 + contents: read 13 + 14 + jobs: 15 + publish: 16 + runs-on: ubuntu-latest 17 + steps: 18 + - name: Checkout code 19 + uses: actions/checkout@v4 20 + 21 + - name: Setup Node.js 22 + uses: actions/setup-node@v6 23 + with: 24 + node-version-file: '.nvmrc' 25 + check-latest: true 26 + registry-url: 'https://registry.npmjs.org' 27 + cache: 'npm' 28 + 29 + - name: Check and publish types 30 + run: | 31 + cd types 32 + VERSION=$(node -p "require('./package.json').version") 33 + echo "Checking @roostorg/types@$VERSION..." 34 + 35 + if npm view "@roostorg/types@$VERSION" version >/dev/null 2>&1; then 36 + echo "⚠️ Version $VERSION of @roostorg/types already exists on npm - skipping" 37 + else 38 + echo "✅ Publishing @roostorg/types@$VERSION..." 39 + npm ci 40 + npm run build 41 + npm publish 42 + fi