Skip to content

Commit

Permalink
Merge pull request #17 from mrbenshef/release-1.0.0
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
zoeyfyi authored Sep 19, 2020
2 parents f1c0148 + c691e2b commit a2cce9c
Show file tree
Hide file tree
Showing 21 changed files with 606 additions and 207 deletions.
164 changes: 58 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,133 +10,85 @@ env:
CARGO_TERM_COLOR: always

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
ci:
name: ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- os: macOS-latest
- os: ubuntu-latest
- os: windows-2019
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
# cache cargo
- uses: actions/cache@v2
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
components: clippy, rustfmt
rust-version: 1.46.0
- name: Cache cargo
uses: actions/cache@v2
if: runner.os != 'macOS'
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# deps
- name: GTK development librarys
################# Dependencies #################
# ======== Linux ========
- name: Linux dependencies
if: runner.os == 'linux'
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# check
- uses: actions-rs/cargo@v1
with:
command: check
# test
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --nocapture
# rustfmt
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
# clippy
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

macos:
name: MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# deps
- name: GTK development librarys
# ======== MacOS ========
- name: MacOS dependencies
if: runner.os == 'macOS'
run: brew install gtk+3 pkg-config
# build
- name: build
run: cargo build
# test
- name: test
run: cargo test -- --nocapture

windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# cache cargo
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# get the last commit of gvsbuild, this will be used as the cache key
- name: get last gvsbuild commit
run: git ls-remote https://github.com/wingtk/gvsbuild.git refs/heads/master > commit.txt
shell: cmd
# cache gvsbuild
- uses: actions/cache@v2
# ======== Windows ========
- name: Windows dependencies (cache gvsbuild)
if: runner.os == 'windows'
uses: actions/cache@v2
id: cache
with:
path: release\**
key: ${{ runner.os }}-gvsbuild--${{ hashFiles('**/commit.txt') }}
- name: make release directory
run: mkdir C:\gtk-build\gtk\x64\release
shell: cmd
if: steps.cache.outputs.cache-hit == 'true'
- name: move release files
key: ${{ runner.os }}-gvsbuild--${{ hashFiles('submodules/gvsbuild/**') }}
- name: Windows dependencies (move gvsbuild files)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit == 'true'
run: xcopy /e /i release C:\gtk-build\gtk\x64\release
shell: cmd
if: steps.cache.outputs.cache-hit == 'true'
- name: debug tree
run: tree C:\gtk-build\gtk\x64\release
shell: cmd
if: steps.cache.outputs.cache-hit == 'true'
# if there was a cache miss, clone
- name: gvsbuild
run: git clone https://github.com/wingtk/gvsbuild.git C:\gtk-build\github\gvsbuild
if: steps.cache.outputs.cache-hit != 'true'
# remove git's bin, there are conflicting cygwin dll's
- name: remove Git
run: rmdir "C:\Program Files\Git\usr\bin" /s /q
- name: Windows dependencies (copy gvsbuild)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
run: xcopy /e /i submodules\gvsbuild C:\gtk-build\github\gvsbuild
- name: Windows dependencies (remove git)
if: runner.os == 'windows'
run: rmdir "C:\Program Files\Git\usr\bin" /s /q # remove git's bin, there are conflicting cygwin dll's
shell: cmd
# fetch gtk dependencies
- name: GTK development librarys
run: python .\build.py build -p=x64 --vs-ver=16 --msys-dir=C:\msys64 -k --enable-gi --py-wheel --py-egg gtk3 gdk-pixbuf
- name: Windows dependencies (gtk)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
run: python .\build.py build -p=x64 --vs-ver=16 --msys-dir=C:\msys64 -k --enable-gi --py-wheel --py-egg gtk3 gdk-pixbuf librsvg hicolor-icon-theme
working-directory: C:\gtk-build\github\gvsbuild
if: steps.cache.outputs.cache-hit != 'true'
- name: Add gvsbuild bin directory to Path
- name: Windows dependencies (add gvsbuild bin directory to path)
if: runner.os == 'windows'
run: echo "::add-path::C:\gtk-build\gtk\x64\release\bin"
# build
- name: build
run: cargo build
# test
- name: test
################# Dependencies #################
- name: Check
run: cargo check
- name: Test
run: cargo test -- --nocapture
# copy lib files for cacheing
- name: make release folder
- name: Fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -D warnings
################# Windows workarounds #################
- name: Windows dependencies (make release folder)
run: mkdir release
shell: cmd
if: steps.cache.outputs.cache-hit != 'true'
- name: move release files
if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
- name: Windows dependencies (move release files)
run: xcopy /e /i C:\gtk-build\gtk\x64\release %cd%\release
shell: cmd
if: steps.cache.outputs.cache-hit != 'true'

if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
71 changes: 55 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.46.0
# cache cargo
- uses: actions/cache@v2
with:
Expand All @@ -41,6 +45,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.46.0
# cache cargo
- uses: actions/cache@v2
with:
Expand All @@ -49,21 +57,36 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# clone gvsbuild
- name: gvsbuild
run: git clone https://github.com/wingtk/gvsbuild.git C:\gtk-build\github\gvsbuild
# remove git's bin, there are conflicting cygwin dll's
- name: remove Git
run: rmdir "C:\Program Files\Git\usr\bin" /s /q
shell: cmd
# fetch gtk dependencies
- name: GTK development libraries (msys)
################# Dependencies #################
- name: Windows dependencies (msys)
if: runner.os == 'windows'
run: C:\msys64\usr\bin\bash.exe -lc "pacman -Syy --noconfirm mingw-w64-x86_64-adwaita-icon-theme"
- name: GTK development libraries (gvsbuild)
run: python .\build.py build -p=x64 --vs-ver=16 --msys-dir=C:\msys64 -k --enable-gi --py-wheel --py-egg gtk3 gdk-pixbuf librsvg hicolor-icon-theme
- name: Windows dependencies (cache gvsbuild)
if: runner.os == 'windows'
uses: actions/cache@v2
id: cache
with:
path: release\**
key: ${{ runner.os }}-gvsbuild--${{ hashFiles('submodules/gvsbuild/**') }}
- name: Windows dependencies (move gvsbuild files)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit == 'true'
run: xcopy /e /i release C:\gtk-build\gtk\x64\release
shell: cmd
- name: Windows dependencies (copy gvsbuild)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
run: xcopy /e /i submodules\gvsbuild C:\gtk-build\github\gvsbuild
- name: Windows dependencies (remove git)
if: runner.os == 'windows'
run: rmdir "C:\Program Files\Git\usr\bin" /s /q # remove git's bin, there are conflicting cygwin dll's
shell: cmd
- name: Windows dependencies (gtk)
if: runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true'
run: python .\build.py build -p=x64 --vs-ver=16 --msys-dir=C:\msys64 -k --enable-gi --py-wheel --py-egg gtk3 gdk-pixbuf gtksourceview3 librsvg hicolor-icon-theme
working-directory: C:\gtk-build\github\gvsbuild
- name: Add gvsbuild bin directory to Path
- name: Windows dependencies (add gvsbuild bin directory to path)
if: runner.os == 'windows'
run: echo "::add-path::C:\gtk-build\gtk\x64\release\bin"
################# Dependencies #################
# install cargo wix
- name: install cargo-wix
run: cargo install cargo-wix
Expand All @@ -82,6 +105,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.46.0
# cache cargo
- uses: actions/cache@v2
with:
Expand All @@ -107,8 +134,18 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.46.0
- uses: snapcore/action-build@v1
id: snapcraft
- uses: snapcore/action-publish@v1
if: github.event_name != 'pull_request'
with:
store_login: ${{ secrets.snapcraft_token }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
- name: rename output
run: mv ${{ steps.snapcraft.outputs.snap }} ./tex-match.snap
- uses: actions/upload-artifact@v2.1.4
Expand All @@ -129,7 +166,7 @@ jobs:
- name: Flatpak remote
run: sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Flatpak SDK's
run: sudo flatpak install -y flathub org.freedesktop.Platform//19.08 org.freedesktop.Sdk//19.08 org.freedesktop.Sdk.Extension.rust-stable//19.08
run: sudo flatpak install -y flathub org.freedesktop.Platform//20.08 org.freedesktop.Sdk//20.08 org.freedesktop.Sdk.Extension.rust-stable//20.08
- name: Flatpak builder
run: wget https://github.com/flatpak/flatpak-builder/releases/download/1.0.10/flatpak-builder-1.0.10.tar.xz && tar -xvf flatpak-builder-1.0.10.tar.xz && cd flatpak-builder-1.0.10 && ./configure --disable-documentation && make && sudo make install
- name: Python TOML
Expand All @@ -152,6 +189,10 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.46.0
# cache cargo
- uses: actions/cache@v2
with:
Expand All @@ -161,9 +202,7 @@ jobs:
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: GTK development librarys
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libgtksourceview-3.0-dev
# set nightly
- run: rustup default nightly
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev
- name: cargo login
run: cargo login ${{ secrets.CRATES }}
- name: cargo publish
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "submodules/flatpak-builder-tools"]
path = submodules/flatpak-builder-tools
url = https://github.com/flatpak/flatpak-builder-tools.git
[submodule "submodules/gvsbuild"]
path = submodules/gvsbuild
url = https://github.com/wingtk/gvsbuild
Loading

0 comments on commit a2cce9c

Please sign in to comment.