Skip to content

Commit

Permalink
fix(ci)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsuu committed Apr 18, 2024
1 parent 2e06389 commit 414e866
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 86 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Deploy static content to Pages

# on:
# # Runs on pushes targeting the default branch
# push:
# branches: ["main"]
#
# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
60 changes: 19 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,26 @@ jobs:
create-release:
name: release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
bin_version: ${{ env.BIN_VERSION }}
steps:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-release
- name: Get the release version from the tag
shell: bash
if: env.BIN_VERSION == ''
run: |
echo "BIN_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.BIN_VERSION }}"
- name: Create GitHub release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.BIN_VERSION }}
release_name: ${{ env.BIN_VERSION }}

build-release:
name: build-release
needs: ["create-release"]
strategy:
matrix:
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
build: [linux, linux-arm, macos, win-msvc]
include:
- build: linux-x86_64
- build: linux
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-aarch64
- build: linux-arm
os: ubuntu-latest
rust: nightly
target: aarch64-unknown-linux-gnu
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: nightly
Expand All @@ -54,36 +37,37 @@ jobs:
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-latest
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}

- name: Add mingw64 to path for x86_64
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly'
shell: bash

run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update -y
sudo apt install -y curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libwayland-egl1-mesa libwayland-client++0 libwayland-client-extra++0
fi
- name: Build
shell: bash
run: |
export RUSTFLAGS="-Awarnings"
cargo build --release
- name: Build archive
shell: bash
run: |
staging="rmg_${{ matrix.build }}_${{ needs.create-release.outputs.bin_version }}"
staging="rmg_${{ matrix.build }}_${{ github.ref_name }}"
mkdir -p "$staging"
cp {README.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
Expand All @@ -97,17 +81,11 @@ jobs:
tar czf "$staging.tar.gz" "$staging"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.ASSET }}
file: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream

overwrite: true

# REFS: https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,31 @@ on:
pull_request:

jobs:
build-build:
build:
name: test
strategy:
matrix:
build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
build: [linux, linux-arm, macos, win-msvc]
include:
- build: linux
os: ubuntu-22.04
os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-gnu
- build: linux-arm
os: ubuntu-22.04
os: ubuntu-latest
rust: nightly
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-12
rust: nightly
target: x86_64-apple-darwin
- build: win-msvc
os: windows-2022
os: windows-latest
rust: nightly
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-2022
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
- build: win32-msvc
os: windows-2022
rust: nightly
target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-test
Expand All @@ -49,9 +41,17 @@ jobs:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Add mingw64 to path for x86_64-gnu
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
if: matrix.rust == 'nightly'
shell: bash
run: |
echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Install dependencies
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update -y
sudo apt install -y curl gcc clang libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libdbus-1-dev libsystemd-dev libseat-dev libpipewire-0.3-dev libpango1.0-dev libwayland-egl1-mesa libwayland-client++0 libwayland-client-extra++0
fi
- name: Build and Test
shell: bash
run: |
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: wasm

# on:
# push:
# branches:
# - main
# pull_request:
on:
push:
branches:
- main
pull_request:

jobs:
build-build:
build:
name: wasm
strategy:
matrix:
build: [linux]
include:
- build: linux
os: ubuntu-22.04
os: ubuntu-lastest
rust: nightly
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-test
Expand All @@ -34,8 +34,9 @@ jobs:
export RUSTFLAGS="-Awarnings"
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
rustup target add wasm32-unknown-unknown
#cargo install wasm-pack
export PATH="$PATH:/home/runner/.cargo/bin/"
cargo install wasm-pack
bash build_web.zsh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
16 changes: 9 additions & 7 deletions build_web.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ build() {
--out-name web.wasm
}

server(){
dufs --render-index \
--allow-search \
./www
#--enable-cors \
}
# server(){
# dufs --render-index \
# --allow-search \
# ./www
# #--enable-cors \
# }
#
#build && server

build && server
build
7 changes: 0 additions & 7 deletions examples/gcd.rs

This file was deleted.

0 comments on commit 414e866

Please sign in to comment.