Skip to content

Commit

Permalink
ci: Use GitHub Actions instead
Browse files Browse the repository at this point in the history
  • Loading branch information
noClaps committed Dec 28, 2024
1 parent 11b087f commit f219b5b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 47 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
test/* -linguist-detectable
dist/* -linguist-detectable
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on: [push, workflow_dispatch]

jobs:
build:
strategy:
matrix:
versions:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
runs-on: ${{ matrix.versions.os }}
name: ${{ matrix.versions.os }}-${{ matrix.versions.target }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.versions.target }}
- run: bun install
- run: bun run build --target ${{ matrix.versions.target }}
- uses: actions/upload-artifact@v4
with:
name: highlight-${{ matrix.versions.target }}
path: dist/

list:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
- run: ls -R dist
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Generated files
dist/

# Testing files
highlight.json
out.html

# Added by cargo
/target
target/
45 changes: 0 additions & 45 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,6 @@
stages:
- build
- publish

push_test:
stage: build
script:
- touch hello.txt
- git config user.name "ZeroLimits Bot"
- git config user.email "[email protected]"
- git add .
- git commit -m "[ci] Built Linux targets"
- git remote rm origin && git remote add origin https://gitlab.com/$CI_PROJECT_PATH.git
- git push HEAD:$CI_COMMIT_REF_NAME HEAD:$CI_COMMIT_REF_NAME

# build_linux:
# stage: build
# image: rust
# before_script:
# - curl -fsSL https://bun.sh/install | bash
# - source /root/.bashrc
# - bun install
# - rustup default stable
# - apt update && apt install wget -y
# - wget https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
# - tar xf zig-linux-x86_64-0.13.0.tar.xz
# - mv zig-linux-x86_64-0.13.0/zig /usr/local/bin/
# - mv zig-linux-x86_64-0.13.0/lib /usr/local/lib/zig
# script:
# - rustup target add x86_64-unknown-linux-gnu
# - bun run build --target x86_64-unknown-linux-gnu

# - rustup target add x86_64-unknown-linux-musl
# - bun run build --target x86_64-unknown-linux-musl

# - rustup target add aarch64-unknown-linux-gnu
# - bun run build --target aarch64-unknown-linux-gnu

# - rustup target add aarch64-unknown-linux-musl
# - bun run build --target aarch64-unknown-linux-musl

# - git config user.name "ZeroLimits Bot"
# - git config user.email "[email protected]"
# - git add .
# - git commit -m "[ci] Built Linux targets"
# - git remote rm origin && git remote add origin [email protected]:$CI_PROJECT_PATH.git
# - git push HEAD:$CI_COMMIT_REF_NAME

publish_job:
stage: publish
image: oven/bun
Expand Down

0 comments on commit f219b5b

Please sign in to comment.