gdevelop-release #2
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: Publish gdcore-tools for new GDevelop version | |
on: | |
repository_dispatch: | |
types: [gdevelop-release] | |
concurrency: | |
cancel-in-progress: true | |
group: release | |
jobs: | |
generate-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: emscripten-core/emsdk | |
path: emsdk | |
- uses: actions/checkout@v4 | |
with: | |
repository: 4ian/GDevelop | |
path: GDevelop | |
ref: refs/tags/${{ github.event.client_payload.release.tag_name }} | |
- uses: actions/checkout@v4 | |
with: | |
path: gdcore-tools | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- run: | | |
sudo apt-get install -y jq | |
./emsdk/emsdk install 3.1.21 | |
./emsdk/emsdk activate 3.1.21 | |
- run: | | |
npm ci | |
new_version="$(node -e "console.log($(jq '.version' package.json).split('-')[0])")-gd_${{ github.event.client_payload.release.tag_name }}" | |
if ${{ github.event.client_payload.release.prerelease }};then new_version="$new_version_prerelease"; fi | |
jq ".version = \"$new_version\"" package.json | |
working-directory: gdcore-tools | |
- run: npm publish --provenance --access public | |
working-directory: gdcore-tools | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Commit & Push changes | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
directory: gdcore-tools |