Merge pull request #58 from Jok3r00666/main #107
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: Zip and Release MCPack | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
if: "startsWith(github.event.head_commit.message, 'v')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' # Use the version you prefer | |
- name: Read version from manifest | |
id: get_version | |
run: | | |
version=$(jq -r '.header.version | map(tostring) | join(".")' manifest.json) | |
echo "Version: $version" | |
echo "::set-output name=version::$version" | |
- name: Create MCPack | |
run: | | |
npm install | |
node ./build.js | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: CHANGELOG.md | |
name: "v${{ steps.get_version.outputs.version }}" | |
tag_name: "v${{ steps.get_version.outputs.version }}" | |
files: | | |
PokeBedrock RES ${{ steps.get_version.outputs.version }}.mcpack | |
PokeBedrock RES ${{ steps.get_version.outputs.version }}.zip | |
draft: false | |
- name: Read CHANGELOG.md | |
id: read_changelog | |
run: | | |
changelog=$(cat CHANGELOG.md) | |
echo "::set-output name=changelog::$changelog" | |
- name: Discord Webhook Action | |
uses: tsickert/discord-webhook@v5.3.0 | |
with: | |
avatar-url: "https://cdn.discordapp.com/avatars/1093906253517959248/afcb43ebb982eebca879819dda0ce635.webp" | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
embed-title: "[RES] Update v${{ steps.get_version.outputs.version }}" | |
embed-description: "${{ steps.read_changelog.outputs.changelog }}" | |
embed-url: "https://github.com/smell-of-curry/pokebedrock-res" | |
filename: "PokeBedrock RES ${{ steps.get_version.outputs.version }}.mcpack" | |