Files
node-minecraft-data/.github/workflows/md-release.yml
Karang 6325e4f7bd Fix release action (#61)
* Fix sed

* on push test

* cleanup test
2021-02-22 02:17:59 +01:00

38 lines
1.6 KiB
YAML

name: Minecraft Data release
on:
repository_dispatch:
types: [mcData-release]
jobs:
update-mcdata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Update minecraft data
run: 'cd minecraft-data/ && git fetch --all --tags && git checkout ${{ github.event.client_payload.tag }}'
- name: Update package.json
run: >
sed -i -E 's/^ "version": "[0-9]+\.[0-9]+\.[0-9]+"/ "version": "${{ github.event.client_payload.tag }}"/g' package.json
- name: Update doc/history.md
run: echo -e "## ${{ github.event.client_payload.tag }}\n* update mcdata\n\n$(cat doc/history.md)" > doc/history.md
- name: Create commits
run: |
git config user.name 'rom1504bot'
git config user.email 'rom1504bot@users.noreply.github.com'
git add minecraft-data
git commit -m "Update Minecraft Data"
git add package.json doc/history.md
git commit -m "Release ${{ github.event.client_payload.tag }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PAT_PASSWORD }}
committer: rom1504bot <rom1504bot@users.noreply.github.com>
author: rom1504bot <rom1504bot@users.noreply.github.com>
signoff: false
branch: release-${{ github.event.client_payload.tag }}
delete-branch: true
title: 'Release ${{ github.event.client_payload.tag }}'
body: |
A new version of minecraft-data was released.