Skip to content

Release 0.20.1

Release 0.20.1 #36

Workflow file for this run

name: Release
on:
push:
tags: ["*.*.*"]
env:
CARGO_TERM_COLOR: always
jobs:
build-binaries:
name: Build binaries
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: gdscript-formatter-${{ github.ref_name }}-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: gdscript-formatter-${{ github.ref_name }}-linux-aarch64
- target: x86_64-apple-darwin
os: macos-latest
name: gdscript-formatter-${{ github.ref_name }}-macos-x86_64
- target: aarch64-apple-darwin
os: macos-latest
name: gdscript-formatter-${{ github.ref_name }}-macos-aarch64
- target: x86_64-pc-windows-msvc
os: windows-latest
name: gdscript-formatter-${{ github.ref_name }}-windows-x86_64.exe
- target: aarch64-pc-windows-msvc
os: windows-latest
name: gdscript-formatter-${{ github.ref_name }}-windows-aarch64.exe
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
# This is a toolchain to build cross-platform binaries with rust. We use
# it for other architectures and OSes than the build runner's.
- name: Install cross
if: matrix.os == 'ubuntu-latest' && matrix.target != 'x86_64-unknown-linux-gnu'
run: cargo install cross --version 0.2.5
# Build either with cross or cargo, depending on the target.
- name: Build binary
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.target }}" != "x86_64-unknown-linux-gnu" ]]; then
cross build --verbose --locked --release --target ${{ matrix.target }}
else
cargo build --verbose --locked --release --target ${{ matrix.target }}
fi
shell: bash
- name: Move and rename binary
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
mv target/${{ matrix.target }}/release/gdscript-formatter.exe ${{ matrix.name }}
else
mv target/${{ matrix.target }}/release/gdscript-formatter ${{ matrix.name }}
fi
shell: bash
- name: Compress to ZIP (All platforms)
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
7z a ${{ matrix.name }}.zip ${{ matrix.name }}
else
zip ${{ matrix.name }}.zip ${{ matrix.name }}
fi
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}.zip
if-no-files-found: error
retention-days: 10
package-godot-addon:
name: Package the Godot add-on
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Create godot-addon.zip
run: zip -r godot-addon.zip addons/
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: godot-addon
path: godot-addon.zip
if-no-files-found: error
retention-days: 10
publish-release:
name: Publish release
needs:
- build-binaries
- package-godot-addon
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Create Release
run: |
gh release create "${{ github.ref_name }}" \
--verify-tag \
--draft \
--title "GDScript formatter ${{ github.ref_name }}" \
--notes "A fast code formatter for GDScript in Godot 4.
You can learn how to install, use, configure, and integrate the formatter into your workflow on this page:
https://www.gdquest.com/library/gdscript_formatter/"
gh release upload "${{ github.ref_name }}" artifacts/*.zip
gh release edit "${{ github.ref_name }}" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash