Update Cargo.lock #38
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: dreamluau | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
force_rebuild: | |
description: "Force Rebuild" | |
required: false | |
type: "boolean" | |
jobs: | |
check-needs-rebuild: | |
outputs: | |
needs-rebuild: ${{ steps.changed-files.outputs.any_changed || contains(github.event.head_commit.message, '[release]') }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Check Modified Files | |
uses: tj-actions/changed-files@v44 | |
if: ${{ !contains(github.event.head_commit.message, '[release]') }} | |
id: changed-files | |
with: | |
files: | | |
**/*.rs | |
Cargo.lock | |
build-windows: | |
runs-on: windows-latest | |
needs: check-needs-rebuild | |
if: ${{ needs.check-needs-rebuild.outputs.needs-rebuild == 'true' || inputs.force_rebuild }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: i686-pc-windows-msvc | |
components: rustfmt, clippy | |
- name: Clippy (all features) | |
run: cargo clippy --target i686-pc-windows-msvc --locked -- -D warnings | |
- name: Rustfmt | |
run: cargo fmt -- --check | |
- name: Build (release) (default features) | |
run: cargo build --target i686-pc-windows-msvc --locked --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dreamluau_windows | |
path: target/i686-pc-windows-msvc/release/dreamluau.dll | |
build-linux: | |
runs-on: ubuntu-20.04 | |
needs: check-needs-rebuild | |
if: ${{ needs.check-needs-rebuild.outputs.needs-rebuild == 'true' || inputs.force_rebuild }} | |
env: | |
BYOND_MAJOR: 515 | |
BYOND_MINOR: 1640 | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install g++-multilib zlib1g-dev:i386 libssl-dev:i386 | |
./scripts/install_byond.sh | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: i686-unknown-linux-gnu | |
- name: Check (all features) | |
run: cargo check --target i686-unknown-linux-gnu --locked | |
- name: Build (Debug) (all features) | |
run: cargo build --target i686-unknown-linux-gnu --locked | |
- name: Run tests (all features) | |
run: cargo test --target i686-unknown-linux-gnu --locked | |
env: | |
BYOND_BIN: /home/runner/BYOND/byond/bin | |
- name: Build (release) (default features) | |
run: cargo build --target i686-unknown-linux-gnu --locked --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dreamluau_linux | |
path: target/i686-unknown-linux-gnu/release/libdreamluau.so | |
release: | |
runs-on: ubuntu-20.04 | |
needs: ["build-windows", "build-linux"] | |
if: contains(github.event.head_commit.message, '[release]') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts | |
id: download_artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Get changelog | |
run: | | |
VERSION=`grep -Po '(?<=^version = ")([^"]+)' ./Cargo.toml` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
CHANGELOG_ENTRY=`grep --color=never -m 1 -Po '## \K(\[[0-9\.]+\].*)' CHANGELOG.md` | |
DESCRIPTION=`bash ./scripts/extract_changelog.sh $CHANGELOG_ENTRY` | |
echo "CHANGELOG_ENTRY=$CHANGELOG_ENTRY" >> $GITHUB_ENV | |
echo "CHANGELOG_DESCRIPTION<<EOF" >> $GITHUB_ENV | |
echo "$DESCRIPTION" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: ${{ env.VERSION }} | |
body: ${{ env.CHANGELOG_DESCRIPTION }} | |
files: | | |
${{ steps.download_artifacts.outputs.download-path }}/dreamluau_linux/libdreamluau.so | |
${{ steps.download_artifacts.outputs.download-path }}/dreamluau_windows/dreamluau.dll |