Skip to content

Commit

Permalink
Merge pull request #44 from B0ney/ver-0.12.0-dev
Browse files Browse the repository at this point in the history
XMODITS 0.12.0
  • Loading branch information
B0ney authored Feb 7, 2024
2 parents ed273ce + 91de84b commit c2d042f
Show file tree
Hide file tree
Showing 233 changed files with 10,950 additions and 9,581 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Uncomment if static_vcruntime fails
# [target.'cfg(all(windows, target_env = "msvc"))']
# rustflags = ["-C", "target-feature=+crt-static"]
243 changes: 22 additions & 221 deletions .github/workflows/build_gui_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,27 @@ on:
workflow_call:

jobs:
build_gui_linux:
name: Building GUI for Linux x86_64
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-

- name: Build Linux GUI binaries
run: cargo build --verbose -p xmodits-gui --release

- name: Create ./bin directory
run: mkdir -p bin

- name: Tarball Linux GUI binary
run: |
tar -czf bin/xmodits-gui-linux-x86_64.tar.gz -C target/release/ xmodits-gui
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-linux-x86_64
path: |
bin/xmodits-gui-linux-x86_64.*
build_gui_linux-cross:
name: Building GUI for ${{ matrix.target }}
runs-on: ubuntu-latest
build:
name: Build
strategy:
matrix:
target:
- linux-aarch64-gnu
- linux-armv7-gnu

include:
- target: linux-aarch64-gnu
arch: aarch64-unknown-linux-gnu

- target: linux-armv7-gnu
arch: armv7-unknown-linux-gnueabihf
- target: linux
os: ubuntu-latest
make: bash dist/build-linux.sh
artifact_path: "target/release/artifact/*"

- target: windows
os: windows-latest
make: powershell dist/build-windows.ps1
artifact_path: "target/release/artifact/*"

- target: macos
os: macos-latest
make: bash dist/build-macos.sh
artifact_path: "target/release/artifact/*"

runs-on: ${{ matrix.target.os }}

steps:
- uses: actions/checkout@v3
Expand All @@ -69,182 +40,12 @@ jobs:
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-

- name: Install cross
run: cargo install cross

- name: Build Linux GUI binaries
run: cross build -p xmodits-gui --release --target ${{ matrix.arch }}

- name: Create ./bin directory
run: mkdir -p bin
- name: Build
run: ${{ matrix.target.make }}

- name: Tarball Linux GUI binary
run: |
tar -czf bin/xmodits-gui-${{ matrix.target }}.tar.gz -C target/${{matrix.arch}}/release/ xmodits-gui
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target }}.*
build_gui_windows:
name: Building GUI for ${{ matrix.target }}
runs-on: windows-latest
strategy:
matrix:
target:
- windows-64-bit
# - windows-32-bit # disabled due to winit bug

include:
- target: windows-64-bit
arch: x86_64-pc-windows-msvc

# - target: windows-32-bit
# arch: i686-pc-windows-msvc

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.arch }}

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-

- name: Install Windows 32 bit target
if: matrix.arch == 'i686-pc-windows-msvc'
run: | # Install 32-bit target and make it the default
rustup target add i686-pc-windows-msvc && rustup default stable-i686-pc-windows-msvc
- name: Build Windows GUI binary
run: cargo build -p xmodits-gui --release

- name: Create ./bin directory
run: mkdir -p bin

- name: Zip Windows GUI binary
run: | # On Windows, remove gui suffix
rm target/release/*xmodits.exe
mv target/release/xmodits-gui.exe target/release/xmodits.exe
Compress-Archive target/release/xmodits.exe bin/xmodits-gui-${{ matrix.target }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target}}.*
build_gui_macos:
name: Building GUI for ${{ matrix.target }}
runs-on: macOS-latest
strategy:
matrix:
target:
- macos-intel
# - macos-apple-slicon # TODO: make this a separate task?
include:
- target: macos-intel
arch: x86_64-apple-darwin
# - target: macos-apple-silicon
# arch: aarch64-apple-darwin

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.arch }}

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-release-

- name: Build macOS GUI binary
run: cargo build -p xmodits-gui --release

- name: Create ./bin directory
run: mkdir -p bin

- name: Zip macOS GUI binary
run: |
mv target/release/xmodits-gui target/release/xmodits
chmod +x target/release/xmodits
zip -j ./bin/xmodits-gui-${{ matrix.target }}.zip target/release/xmodits
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: xmodits-gui-${{ matrix.target }}
path: |
bin/xmodits-gui-${{ matrix.target }}.*
# build:
# name: Building ${{ matrix.build_target }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# build_target: [linux, windows]
# include:
# - build_target: linux
# os: ubuntu-latest
# - build_target: windows
# os: windows-latest

# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@stable
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target
# key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.OS }}-release-

# - name: Building GUI
# run: cargo build -p xmodits-gui --release

# - name: Create ./bin directory
# run: mkdir -p bin

# - name: Tarball Linux GUI binary
# if: matrix.os != 'windows-latest'
# run: |
# tar -czf bin/xmodits-gui-${{ matrix.build_target }}.tar.gz -C target/release/ xmodits-gui

# - name: Zip Windows GUI binary
# if: matrix.os == 'windows-latest'
# run: | # On Windows, remove gui suffix
# rm target/release/*xmodits.exe
# mv target/release/xmodits-gui.exe target/release/xmodits.exe
# Compress-Archive target/release/xmodits.exe bin/xmodits-gui-${{ matrix.build_target }}.zip

# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: xmodits-gui-${{ matrix.build_target }}
# path: |
# bin/xmodits-gui-${{ matrix.build_target }}.*
name: ${{ matrix.target.target }}
path: ${{ matrix.target.artifact_path }}
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
name: unit_testing
name: typo-check

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
check-typos:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: typos-action
uses: crate-ci/[email protected]
60 changes: 3 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Publish

on:
# release:
# workflow_dispatch:
# workflow_call:
push:
# branches:
# - main
tags:
- 'v*'

Expand All @@ -16,74 +11,25 @@ permissions:
jobs:
build-gui:
uses: ./.github/workflows/build_gui_artifacts.yml
# build-cli:
# uses: ./.github/workflows/build_cli_artifacts.yml

release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

needs: build-gui
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: bin
- name: Create pre-release
- name: Create draft-release
uses: softprops/action-gh-release@v1
with:
files: bin/*/xmodits-*
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# upload-compiled-binary:
# # The type of runner that the job will run on
# runs-on: ubuntu-latest

# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# - uses: actions/checkout@v3

# - name: setup rustup
# run: |
# rustup override set 1.60
# rustup target add x86_64-pc-windows-gnu

# - uses: Swatinem/rust-cache@v1

# - name: install deps
# run: sudo apt install -y mingw-w64

# - name: compile linux
# run: cargo build --release -p xmodits

# - name: compile windows
# run: cargo build --target=x86_64-pc-windows-gnu --release -p xmodits --bin xmodits --bin xmodits-cli

# - name: version
# run: echo "::set-output name=version::$(./target/release/xmodits -v)"
# id: version

# - name: copy_extra_files
# run: |
# cp ./LICENSE ./target/release/
# cp ./README.md ./target/release/

# cp ./LICENSE ./target/x86_64-pc-windows-gnu/release/
# cp ./README.md ./target/x86_64-pc-windows-gnu/release/


# - name: zip up linux
# run: zip -j xmodits-linux ./target/release/{xmodits,LICENSE,README.md}

# - name: zip up windows
# run: zip -j xmodits-windows ./target/x86_64-pc-windows-gnu/release/{xmodits.exe,LICENSE,README.md}

# - uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: "xmodits-linux.zip,xmodits-windows.zip"
# token: ${{ github.token }}
# tag: ${{ steps.version.outputs.version }}
Loading

0 comments on commit c2d042f

Please sign in to comment.