Merge pull request #137 from Fubukimaru/iss132 #198
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: Build | |
on: | |
release: | |
types: [released] | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- 'doc/**' | |
- 'ref/**' | |
- '*.md' | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- 'doc/**' | |
- 'ref/**' | |
- '*.md' | |
jobs: | |
windows: | |
name: windows ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: i686 | |
bits: "32" | |
- target: x86-64 | |
bits: "64" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install deps | |
run: | | |
sudo apt update | |
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev | |
sudo apt install -y gcc-mingw-w64-${{ matrix.target }} g++-mingw-w64-${{ matrix.target }} | |
- name: make | |
run: make asmsx${{ matrix.bits }}.exe | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmsx-win-${{ matrix.target }} | |
path: asmsx*.exe | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install deps | |
run: | | |
sudo apt update | |
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev | |
- run: make | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmsx-linux-x86_64 | |
path: asmsx | |
linux-armhf: | |
needs: linux | |
runs-on: ubuntu-latest | |
env: | |
GCC_VERSION: "10.2-2020.11" | |
BUILD_TARGET: arm-none-linux-gnueabihf | |
GCC_NAME: "gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install deps | |
run: | | |
sudo apt update | |
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev | |
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/${{ env.GCC_VERSION }}/binrel/${{ env.GCC_NAME }}.tar.xz | |
tar xvf ${{ env.GCC_NAME }}.tar.xz | |
- name: make | |
run: make CC=${{ env.GCC_NAME }}/bin/${{ env.BUILD_TARGET }}-gcc LDFLAGS="-static" | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmsx-linux-armhf | |
path: asmsx | |
osx: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: install deps | |
run: brew install flex bison | |
- name: make | |
run: make | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: asmsx-darwin | |
path: asmsx | |
test: | |
runs-on: ubuntu-latest | |
needs: linux | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: asmsx-linux-x86_64 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies and fix permissions | |
run: | | |
sudo apt update | |
sudo apt install -y dos2unix | |
pip3 install --upgrade pip behave | |
chmod a+x asmsx | |
- run: make test | |
release: | |
name: Upload to Release | |
runs-on: ubuntu-latest | |
needs: [windows, linux, linux-armhf, osx] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: assets | |
- name: Rename artifacts | |
working-directory: assets | |
run: | | |
for FOLDER in *; do | |
cd $FOLDER | |
chmod a+x * | |
if [[ "$FOLDER" == *"-win"* ]]; then | |
mv * $(basename $PWD).exe | |
else | |
mv * $(basename $PWD) | |
fi | |
cd .. | |
done | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: 'assets/asmsx-*/*' | |