mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 23:23:30 +00:00
105 lines
3.3 KiB
YAML
105 lines
3.3 KiB
YAML
name: Release Drafter
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build_extension:
|
|
strategy:
|
|
matrix:
|
|
os_target:
|
|
- { os: "windows-latest", target: "i686-pc-windows-msvc", artifact: "armatak.dll" }
|
|
- { os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact: "armatak.dll" }
|
|
- { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact: "libarmatak.so" }
|
|
runs-on: ${{ matrix.os_target.os }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
- name: Install Rust Toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
target: ${{ matrix.os_target.target }}
|
|
toolchain: stable
|
|
default: true
|
|
- name: Install Dependencies (Linux only)
|
|
if: matrix.os_target.os == 'ubuntu-latest'
|
|
run: sudo apt-get update && sudo apt-get install -y build-essential
|
|
- name: Cargo Build
|
|
run: cargo build --release --target ${{ matrix.os_target.target }}
|
|
- name: Check Stuff
|
|
run: ls target/release
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.os_target.target }}
|
|
path: target/${{ matrix.os_target.target }}/release/${{ matrix.os_target.artifact }}
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
package:
|
|
needs: [build_extension]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
- run: mkdir -p ./target/release
|
|
- name: Download Windows x64 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: x86_64-pc-windows-msvc
|
|
- run: mv ./armatak.dll ./armatak_x64.dll
|
|
- name: Download Windows x86 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: i686-pc-windows-msvc
|
|
- name: Download Linux x64 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: x86_64-unknown-linux-gnu
|
|
- run: mv ./libarmatak.so ./armatak_x64.so
|
|
- name: Setup HEMTT
|
|
uses: arma-actions/hemtt@v1
|
|
- name: Build
|
|
run: hemtt release
|
|
- name: Get previous tag
|
|
id: prev_tag
|
|
run: |
|
|
tag=$(git describe --tags --abbrev=0 HEAD^ || echo "")
|
|
echo "tag=${tag}" >> $GITHUB_ENV
|
|
continue-on-error: true
|
|
- name: Get commit messages
|
|
id: commits
|
|
run: |
|
|
echo "COMMIT_MESSAGES=$(git log ${{ env.PREVIOUS_TAG }}..HEAD --pretty=format:'%h - %s' | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref }}
|
|
body: |
|
|
Changes in this release:
|
|
${{ github.event.head_commit.message }}
|
|
draft: true
|
|
prerelease: false
|
|
- name: Upload Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: releases/armatak-latest.zip
|
|
asset_name: armatak.zip
|
|
asset_content_type: application/zip |