Update automated weekly update workflow*** #1
Workflow file for this run
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: Automated Weekly Update | |
on: | |
push: | |
branches: | |
- test-actions | |
# Automatic runs every Monday at 00:00 UTC | |
# schedule: | |
# - cron: '0 0 * * 1' | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
ssh-strict: true | |
persist-credentials: false | |
clean: true | |
lfs: false | |
submodules: false | |
set-safe-directory: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org/' | |
cache: 'pnpm' | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Update Contracts | |
env: | |
RONIN_EXPLORER_API_URL: ${{ secrets.RONIN_EXPLORER_API_URL }} | |
run: pnpm run update-contracts | |
- name: Format | |
run: pnpm format | |
- name: Check for changes | |
id: git-check | |
run: | | |
git diff --quiet && git diff --staged --quiet || echo "::set-output name=changes_detected::true" | |
- name: Increment package version | |
if: steps.git-check.outputs.changes_detected == 'true' | |
run: | | |
pnpm version patch --no-git-tag-version | |
- name: Create Pull Request | |
if: steps.git-check.outputs.changes_detected == 'true' | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.PAT }} | |
commit-message: 'chore: update package version' | |
branch: 'updates/${{ github.run_number }}' | |
delete-branch: true | |
title: 'Automated Package Version Update' | |
body: 'This is an automated PR to update package version.' | |
labels: 'automated pr' | |
assignees: 'alexx855' | |
reviewers: 'alexx855' | |
- name: Publish to npm | |
if: steps.git-check.outputs.changes_detected == 'true' | |
run: pnpm upload | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |