Skip to content

Commit

Permalink
build: 👷 upgrade release-please-action
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Feb 2, 2024
1 parent 0f3cb92 commit 7ec3975
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 117 deletions.
126 changes: 65 additions & 61 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,96 +5,100 @@ on:
- master

jobs:
change-finder:
runs-on: ubuntu-latest
name: Change Finder
# change-finder:
# runs-on: ubuntu-latest
# name: Change Finder

outputs:
changed: ${{ steps.find.outputs.changed }}
plugins: ${{ steps.find.outputs.plugins }}
# outputs:
# changed: ${{ steps.find.outputs.changed }}
# plugins: ${{ steps.find.outputs.plugins }}

steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
# steps:
# - name: Check Out
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

- name: Find
id: find
run: |
npm i @actions/core
node changeFinder.js
# - name: Find
# id: find
# run: |
# npm i @actions/core
# node changeFinder.js

release-please-pr:
# 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:
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) }}
name: Release Please

outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
paths_released: ${{ steps.release-please.outputs.paths_released }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
all: ${{ steps.release-please.outputs }}

steps:
- name: Release Please PR
uses: google-github-actions/release-please-action@v3
- name: Release Please
uses: google-github-actions/release-please-action@v4
id: release-please
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:
config-file: .release-please/release-please-config.json
manifest-file: .release-please/.release-please-manifest.json

- run: |
echo "${{ steps.release-please.outputs }}"
build:
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) }}
name: Build
needs: release-please

steps:
- name: Release Please Release
uses: google-github-actions/release-please-action@v3
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}'
- run: |
echo "${{ needs.release-please.outputs }}"
echo "${{ needs.release-please.outputs.all }}"
- name: Check Out
uses: actions/checkout@v3
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
uses: actions/checkout@v4

- 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'
python-version: '3.12'

- 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 }}
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 }}
gh release upload ${{ needs.release-please.outputs[format('{0}--tag_name', matrix.plugin)] }} ${{ steps.pack.outputs.name }}
18 changes: 18 additions & 0 deletions .release-please/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"src/advanced_calculator": "0.3.1",
"src/bingo": "0.0.3",
"src/bot": "1.1.2",
"src/database_api": "0.1.1",
"src/dict_command_registration": "1.1.0",
"src/fastapi_mcdr": "1.0.0",
"src/gamemode": "1.1.0",
"src/info": "0.2.0",
"src/let_me_click_and_send": "1.0.0",
"src/lowercase_mcdr_command": "1.2.2",
"src/minecraft_command_register": "1.7.3",
"src/more_command_nodes": "1.1.0",
"src/online_player_api": "1.0.0",
"src/qq_api": "1.3.1",
"src/qq_chat": "2.1.0",
"src/uuid_api": "0.1.2"
}
45 changes: 45 additions & 0 deletions .release-please/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"release-type": "simple",
"pull-request-title-pattern": "chore${scope}: 🔖 release${component} ${version}",
"extra-files": [
{
"type": "json",
"path": "mcdreforged.plugin.json",
"jsonpath": "$.json"
}
],
"packages": {
"src/advanced_calculator": {
},
"src/bingo": {
},
"src/bot": {
},
"src/database_api": {
},
"src/dict_command_registration": {
},
"src/fastapi_mcdr": {
},
"src/gamemode": {
},
"src/info": {
},
"src/let_me_click_and_send": {
},
"src/lowercase_mcdr_command": {
},
"src/minecraft_command_register": {
},
"src/more_command_nodes": {
},
"src/online_player_api": {
},
"src/qq_api": {
},
"src/qq_chat": {
},
"src/uuid_api": {
}
}
}
38 changes: 0 additions & 38 deletions changeFinder.js

This file was deleted.

18 changes: 0 additions & 18 deletions plugin_list.json

This file was deleted.

0 comments on commit 7ec3975

Please sign in to comment.