Update types #117
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
name: Update types | |
on: | |
schedule: | |
- cron: '0 0 * * 1' | |
- cron: '0 0 * * 3' | |
- cron: '0 0 * * 5' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [ 20 ] | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
- name: Get current package version | |
id: current_version | |
run: echo "current_version=$(npm pkg get version | cut -d '"' -f2)" >> $GITHUB_OUTPUT | |
- name: Update types | |
run: npm run start | |
- name: Get updated package version | |
id: updated_version | |
run: echo "updated_version=$(npm pkg get version | cut -d '"' -f2)" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: | | |
dist | |
package.json | |
author_name: Defkil | |
author_email: [email protected] | |
message: 'bot: Update types and package version' | |
- name: Publish to npm | |
if: steps.current_version.outputs.current_version != steps.updated_version.outputs.updated_version | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --provenance --access public |