-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
仅在 NBT 模式下要求 nbtlib 前置
- Loading branch information
Showing
6 changed files
with
113 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Dev packages | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
pack: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
working-directory: ./src | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install mcdreforged | ||
[[ -f requirements.txt ]] && pip install -r requirements.txt | ||
- name: Pack the plugin | ||
run: python -m mcdreforged pack -i src -o dist | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: pack-artifacts | ||
path: dist/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
inputs: | ||
target_release_tag: | ||
description: The tag of the release you want to append the artifact to | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
working-directory: ./src | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install mcdreforged | ||
[[ -f requirements.txt ]] && pip install -r requirements.txt | ||
- name: Pack plugin | ||
run: python -m mcdreforged pack -o dist | ||
|
||
- name: Find tag name | ||
id: release_info | ||
run: | | ||
if [ $GITHUB_EVENT_NAME == 'release' ] | ||
then | ||
echo "::set-output name=tag_name::" # leave an empty value here so softprops/action-gh-release will use the default value | ||
elif [ $GITHUB_EVENT_NAME == 'workflow_dispatch' ] | ||
then | ||
echo "::set-output name=tag_name::${{ github.event.inputs.target_release_tag }}" | ||
else | ||
echo Unknown github event name $GITHUB_EVENT_NAME | ||
exit 1 | ||
fi | ||
- name: Find packed plugin | ||
id: findplugin | ||
run: | | ||
output="$(ls dist)" | ||
echo "::set-output name=pluginname::$output" | ||
- name: Upload to Github Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/${{ steps.findplugin.outputs.pluginname }} | ||
tag_name: ${{ steps.release_info.outputs.tag_name }} |
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
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
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
This file was deleted.
Oops, something went wrong.