build: π· upgrade release-please-action #293
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: Release Please | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
change-finder: | |
runs-on: ubuntu-latest | |
name: Change Finder | |
outputs: | |
changed: ${{ steps.find.outputs.changed }} | |
plugins: ${{ steps.find.outputs.plugins }} | |
steps: | |
- name: Check Out | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Find | |
id: find | |
run: | | |
npm i @actions/core | |
node changeFinder.js | |
release-please-pr: | |
runs-on: ubuntu-latest | |
name: Release Please PR | |
needs: | |
- change-finder | |
- release-please-release | |
strategy: | |
fail-fast: false | |
matrix: | |
plugin: ${{ fromJson(needs.change-finder.outputs.plugins) }} | |
steps: | |
- name: Release Please PR | |
uses: google-github-actions/release-please-action@v4 | |
with: | |
release-type: simple | |
package-name: ${{ matrix.plugin }} | |
path: ${{ matrix.plugin }} | |
monorepo-tags: true | |
command: release-pr | |
pull-request-title-pattern: 'chore${scope}: π release${component} ${version}' | |
release-please-release: | |
runs-on: ubuntu-latest | |
name: Release Please Release | |
needs: change-finder | |
if: ${{ needs.change-finder.outputs.changed == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
plugin: ${{ fromJson(needs.change-finder.outputs.plugins) }} | |
steps: | |
- name: Release Please Release | |
uses: google-github-actions/release-please-action@v4 | |
id: release_please_release | |
with: | |
release-type: simple | |
package-name: ${{ matrix.plugin }} | |
path: ${{ matrix.plugin }} | |
monorepo-tags: true | |
command: github-release | |
pull-request-title-pattern: 'chore${scope}: π release${component} ${version}' | |
- name: Check Out | |
uses: actions/checkout@v3 | |
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }} | |
with: | |
python-version: '3.10' | |
- name: Install Dependencies | |
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }} | |
run: | | |
python -m pip install --upgrade pip | |
pip install mcdreforged | |
- name: Pack | |
id: pack | |
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }} | |
run: | | |
python -m mcdreforged pack --ignore-patterns __pycache__ -i ${{ matrix.plugin }} | |
echo "name=$(ls *.mcdr)" >> $GITHUB_OUTPUT | |
- name: Upload | |
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh release upload ${{ steps.release_please_release.outputs[format('{0}--tag_name', matrix.plugin)] }} ${{ steps.pack.outputs.name }} |