Skip to content

Commit

Permalink
feat: add provenance (#5908)
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud authored Nov 20, 2023
1 parent 2190c89 commit 35693fd
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 37 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
concurrency: ci-gh-pages
outputs:
release_tag: ${{ steps.updated_version.outputs.version }}
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -97,21 +99,23 @@ jobs:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
directory: packages/vkui/

- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Generate archive
working-directory: ./packages/vkui
run: yarn pack

- name: Publishing with latest tag
working-directory: ./packages/vkui
if: ${{ github.event.inputs.latest == 'true' }}
run: yarn workspace @vkontakte/vkui npm publish
run: npm publish package.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}

- name: Publishing with legacy tag
working-directory: ./packages/vkui
if: ${{ github.event.inputs.latest != 'true' }}
run: yarn workspace @vkontakte/vkui npm publish --tag legacy
run: npm publish package.tgz --tag legacy
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}

- name: Creating doc for stable release
if: ${{ github.event.inputs.latest == 'true' }}
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
concurrency: ci-gh-pages
outputs:
release_tag: ${{ steps.updated_version.outputs.version }}
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -97,17 +99,16 @@ jobs:
branch: ${{ github.ref }}
tags: true

- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Generate archive
working-directory: ./packages/vkui
run: yarn pack

- name: Publishing release
working-directory: ./packages/vkui
run: |
yarn workspace @vkontakte/vkui npm publish --tag ${{ github.event.inputs.tag }}
npm publish package.tgz --tag ${{ github.event.inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}

- name: Build styleguide
run: yarn run docs:styleguide:build --dist dist/${{ steps.updated_version.outputs.version }}
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/publish_token_translator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
defaults:
run:
working-directory: ./packages/token-translator

permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -70,14 +71,11 @@ jobs:
branch: ${{ github.ref }}
tags: true

- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Generate archive
run: yarn pack

- name: Publishing release
run: |
yarn npm publish
npm publish package.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
19 changes: 10 additions & 9 deletions .github/workflows/publish_vkui_floating_ui_react_dom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ run-name: Publish @vkontakte/vkui-floating-ui ${{ inputs.custom_version }} ${{ i

jobs:
publish:
permissions:
id-token: write
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -89,20 +91,19 @@ jobs:
branch: ${{ github.ref }}
tags: true

- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Generate archive
run: yarn pack

- name: Publishing tagged release
if: ${{ github.event.inputs.tag }}
run: |
yarn npm publish --tag ${{ github.event.inputs.tag }}
npm publish package.tgz --tag ${{ github.event.inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}

- name: Publishing release
if: ${{ !github.event.inputs.tag }}
run: |
yarn npm publish
npm publish package.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
3 changes: 3 additions & 0 deletions packages/token-translator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
"build": "tsc",
"test": "jest",
"test:ci": "yarn test"
},
"publishConfig": {
"provenance": true
}
}
5 changes: 4 additions & 1 deletion packages/vkui-floating-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@
"devDependencies": {
"@swc/core": "^1.3.96"
},
"packageManager": "yarn@3.6.3"
"packageManager": "yarn@3.6.3",
"publishConfig": {
"provenance": true
}
}
5 changes: 4 additions & 1 deletion packages/vkui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,8 @@
"path": "dist/vkui.css",
"webpack": false
}
]
],
"publishConfig": {
"provenance": true
}
}

0 comments on commit 35693fd

Please sign in to comment.