chore(deps): minor update dependencies (#988) #87
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
on: | |
push: | |
branches: | |
- master | |
name: release-please-submodule | |
jobs: | |
changeFinder: | |
runs-on: ubuntu-latest | |
outputs: | |
nodePaths: ${{ steps.interrogate.outputs.nodePaths }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: interrogate | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
retries: 5 | |
script: | | |
const {execSync} = require('child_process'); | |
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); | |
const latestRelease = await github.rest.repos.getLatestRelease({ | |
owner, | |
repo | |
}); | |
console.log(`latest release: ${JSON.stringify(latestRelease.data)}`); | |
execSync('git pull --tags'); | |
execSync(`git reset --hard ${latestRelease.data.tag_name}`); | |
const status = execSync(`git diff --name-only origin/master`, { encoding: 'utf-8'}); | |
console.log(status); | |
const changes = status.split('\n'); | |
let nodePaths = new Set(); | |
for (const change of changes) { | |
if (change.startsWith('packages/')) { | |
const library = change.split('/')[1]; | |
nodePaths.add(library); | |
}; | |
} | |
nodePaths = Array.from(nodePaths); | |
console.log(`::set-output name=nodePaths::${JSON.stringify(nodePaths)}`); | |
release-please-release: | |
runs-on: ubuntu-latest | |
needs: changeFinder | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{fromJson(needs.changeFinder.outputs.nodePaths)}} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: tag-release | |
with: | |
path: packages/${{ matrix.package }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
monorepo-tags: true | |
package-name: ${{ matrix.package }} | |
command: github-release | |
- uses: actions/checkout@v3 | |
if: ${{ steps.tag-release.outputs.releases_created }} | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
- uses: actions/setup-node@v3 | |
if: ${{ steps.tag-release.outputs.releases_created }} | |
with: | |
node-version: 14 | |
registry-url: 'https://external-dot-oss-automation.appspot.com/' | |
cache: 'pnpm' | |
- name: publish | |
if: ${{ steps.tag-release.outputs.releases_created }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: | | |
pnpm install | |
pnpm publish --filter ${{ matrix.package }} --no-git-checks --access public | |
release-pr: | |
runs-on: ubuntu-latest | |
needs: | |
- changeFinder | |
- release-please-release | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{fromJson(needs.changeFinder.outputs.nodePaths)}} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release-please | |
with: | |
path: packages/${{ matrix.package }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
package-name: ${{ matrix.package }} | |
monorepo-tags: true | |
command: release-pr |