Add publish release workflow #1
Workflow file for this run
This file contains hidden or 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 release | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
jobs: | |
fetch-core-libs: | |
runs-on: ubuntu-22.04 | |
env: | |
CORE_LIB_REPO: tomwyr/godot-node-tree-core | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Resolve core lib version | |
id: resolve-version | |
run: scripts/resolve-core-lib-version.sh | |
- name: Download core libs | |
run: scripts/download-core-libs.sh | |
env: | |
CORE_LIB_VERSION: ${{ steps.resolve-version.outputs.core_lib_version }} | |
TARGET_PLATFORMS: "macos linux windows" | |
LIB_EXTENSIONS: ".dylib .so .dll" | |
- name: Upload core libs artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-libs | |
path: core-libs | |
run-tests: | |
needs: fetch-core-libs | |
runs-on: macos-14 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download core libs artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: core-libs | |
path: core-libs | |
- name: Restore core libs | |
run: scripts/restore-core-libs.sh | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Create properties from environment | |
run: sh scripts/create-properties.sh | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew test | |
create-release: | |
needs: run-tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: core-libs | |
merge-multiple: true | |
- name: Get release id | |
id: release-id | |
run: | | |
version=${{ github.ref_name }} | |
date=$(date +'%Y-%m-%d') | |
id=$(echo "$version - $data" | tr '.' -d | tr ' ' '-') | |
echo "id=$id" >> $GITHUB_OUTPUT | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ github.ref_name }} | |
body: | | |
[Changelog](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#${{ steps.release-id.outputs.id }}) |