Skip to content

Fix failure to build modules with GCC (#105) #49

Fix failure to build modules with GCC (#105)

Fix failure to build modules with GCC (#105) #49

Workflow file for this run

name: Zork++ Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
generate-release:
permissions:
contents: write
runs-on: 'ubuntu-latest'
steps:
- name: Generate release ${{ steps.version.outputs.version }}
uses: actions/create-release@v1
id: create-release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
generate-binaries:
needs: 'generate-release'
permissions:
contents: write
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Caching cargo dependencies
id: project-cache
uses: Swatinem/rust-cache@v2
- name: Make Rust environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Building Zork's exe
working-directory: ./zork++
run: |
cargo build --release
- name: Install cargo-deb
run: |
cargo install cargo-deb
- name: Generate .deb package for Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./zork++
run: |
cargo deb --no-build --output ./target/debian/zork.deb
mv ./target/debian/zork.deb ./target/debian/zork++.deb
- name: Building the installer with Inno Setup
if: ${{ matrix.os == 'windows-latest' }}
run: |
rename ".\zork++\target\release\zork.exe" "zork++.exe"
"%programfiles(x86)%\Inno Setup 6\iscc.exe" ".\release-config\windows-installer-zork.iss"
shell: cmd
- name: Make Zip for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
7z a windows-installer.zip zork-installer.exe
- name: Generate compressed tar archive for Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./zork++
run: |
mv ./target/release/zork ./target/release/zork++
tar -czvf zork++.tar.gz ./target/release/zork++ ../LICENSE
- name: Upload Windows artifact
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: windows-installer.zip
asset_name: windows-installer.zip
asset_content_type: application/zip
- name: Upload Linux tar archive
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: ./zork++/zork++.tar.gz
asset_name: ./zork++/zork++.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Linux .deb package
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: zork++/target/debian/zork++.deb
asset_name: zork++.deb
asset_content_type: application/vnd.debian.binary-package