ci: stick to 1 scope #35
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: Node.js Package | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- '**/botaction' | |
release: | |
types: [created] | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- run: test -f /usr/bin/jq || sudo apt install -y --no-install-recommends jq | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "21.x" | |
- run: corepack enable && yarn install | |
- run: yarn build | |
publish-gpr: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "21.x" | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@tt" | |
- run: corepack enable | |
- name: Configure SSH/Git permissions | |
run: | | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
chmod 600 ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK >/dev/null 2>&1 | |
ssh-add - <<< "${{ secrets.DEPLKEY_PRIV }}" | |
- run: git config --global user.email "[email protected]" && git config --global user.name "$GITHUB_ACTOR" | |
- run: yarn version patch | |
- run: echo "NEW_TAG=$(jq .version <package.json)" >> "$GITHUB_ENV" | |
- run: git tag v$NEW_TAG | |
- run: git add package.json && git commit -m "[skip ci] [auto-semver-tag] auto tag v$NEW_TAG" | |
- run: git remote set-url origin [email protected]:/MoreChickenDelivered/md-loader | |
- run: git push --tags && git push | |
- run: yarn npm publish | |