summaryrefslogtreecommitdiff
path: root/.github/workflows/deploy.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/deploy.yml')
-rw-r--r--.github/workflows/deploy.yml251
1 files changed, 251 insertions, 0 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..d047f1c
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -0,0 +1,251 @@
+name: Deploy Build
+
+on:
+ push:
+ branches: [github_action/deploy]
+ pull_request:
+ branches: [github_action/deploy]
+
+env:
+ CARGO_TERM_COLOR: always
+ RUST_VERSION: 1.92.0
+ RUST_TOOLCHAIN: stable
+
+jobs:
+ build-windows:
+ name: Build Windows (x86_64-pc-windows-msvc)
+ runs-on: windows-latest
+
+ steps:
+ - name: Checkout CommandLine repository
+ uses: actions/checkout@v4
+ with:
+ ref: github_action/deploy
+ path: CommandLine
+
+ - name: Checkout VersionControl repository
+ uses: actions/checkout@v4
+ with:
+ repository: JustEnoughVCS/VersionControl
+ ref: github_action/deploy
+ path: VersionControl
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_VERSION }}
+ target: x86_64-pc-windows-msvc
+
+ - name: Cache cargo registry
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Cache cargo build
+ uses: actions/cache@v4
+ with:
+ path: CommandLine/target
+ key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Clone Documents repository
+ run: |
+ cd VersionControl
+ if (!(Test-Path docs)) { New-Item -ItemType Directory -Path docs }
+ cd docs
+ git clone https://github.com/JustEnoughVCS/Documents.git --branch main
+
+ - name: Run tests for VersionControl
+ run: |
+ cd VersionControl
+ cargo test --workspace
+
+ - name: Run tests for CommandLine
+ run: |
+ cd CommandLine
+ cargo test --workspace
+
+ - name: Build release
+ run: |
+ cd CommandLine
+ cargo build --workspace --release --target x86_64-pc-windows-msvc
+
+ - name: Export artifacts
+ run: |
+ cd CommandLine
+ cargo run --manifest-path tools/build_helper/Cargo.toml --bin exporter x86_64-pc-windows-msvc
+
+ - name: Install Inno Setup
+ run: |
+ choco install innosetup -y
+
+ - name: Create Windows installer
+ run: |
+ cd CommandLine
+ ISCC /Q .\scripts\setup\windows\setup_jv_cli.iss
+
+ - name: Upload Windows artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: JustEnoughVCS_Windows
+ path: CommandLine/.temp/JustEnoughVCS_Windows.exe
+ if-no-files-found: error
+
+ build-linux-gnu:
+ name: Build Linux GNU (x86_64-unknown-linux-gnu)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout CommandLine repository
+ uses: actions/checkout@v4
+ with:
+ ref: github_action/deploy
+ path: CommandLine
+
+ - name: Checkout VersionControl repository
+ uses: actions/checkout@v4
+ with:
+ repository: JustEnoughVCS/VersionControl
+ ref: github_action/deploy
+ path: VersionControl
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_VERSION }}
+ target: x86_64-unknown-linux-gnu
+
+ - name: Cache cargo registry
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Cache cargo build
+ uses: actions/cache@v4
+ with:
+ path: CommandLine/target
+ key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Clone Documents repository
+ run: |
+ cd VersionControl
+ mkdir -p docs
+ cd docs
+ git clone https://github.com/JustEnoughVCS/Documents.git --branch main
+
+ - name: Run tests for VersionControl
+ run: |
+ cd VersionControl
+ cargo test --workspace
+
+ - name: Run tests for CommandLine
+ run: |
+ cd CommandLine
+ cargo test --workspace
+
+ - name: Build release
+ run: |
+ cd CommandLine
+ cargo build --workspace --release --target x86_64-unknown-linux-gnu
+
+ - name: Export artifacts
+ run: |
+ cd CommandLine
+ cargo run --manifest-path tools/build_helper/Cargo.toml --bin exporter x86_64-unknown-linux-gnu
+
+ - name: Create Linux GNU tarball
+ run: |
+ cd CommandLine/.temp/deploy
+ tar -czf ../../JustEnoughVCS_Linux_GNU.tar.gz .
+
+ - name: Upload Linux GNU artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: JustEnoughVCS_Linux_GNU
+ path: CommandLine/JustEnoughVCS_Linux_GNU.tar.gz
+ if-no-files-found: error
+
+ build-linux-musl:
+ name: Build Linux MUSL (x86_64-unknown-linux-musl)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout CommandLine repository
+ uses: actions/checkout@v4
+ with:
+ ref: github_action/deploy
+ path: CommandLine
+
+ - name: Checkout VersionControl repository
+ uses: actions/checkout@v4
+ with:
+ repository: JustEnoughVCS/VersionControl
+ ref: github_action/deploy
+ path: VersionControl
+
+ - name: Setup Rust with musl target
+ uses: dtolnay/rust-toolchain@master
+ with:
+ toolchain: ${{ env.RUST_VERSION }}
+ target: x86_64-unknown-linux-musl
+
+ - name: Install musl-tools
+ run: sudo apt-get update && sudo apt-get install -y musl-tools
+
+ - name: Cache cargo registry
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Cache cargo build
+ uses: actions/cache@v4
+ with:
+ path: CommandLine/target
+ key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
+
+ - name: Clone Documents repository
+ run: |
+ cd VersionControl
+ mkdir -p docs
+ cd docs
+ git clone https://github.com/JustEnoughVCS/Documents.git --branch main
+
+ - name: Run tests for VersionControl
+ run: |
+ cd VersionControl
+ cargo test --workspace
+
+ - name: Run tests for CommandLine
+ run: |
+ cd CommandLine
+ cargo test --workspace
+
+ - name: Build release with musl
+ run: |
+ cd CommandLine
+ cargo build --workspace --release --target x86_64-unknown-linux-musl
+
+ - name: Export artifacts for musl
+ run: |
+ cd CommandLine
+ cargo run --manifest-path tools/build_helper/Cargo.toml --bin exporter x86_64-unknown-linux-musl
+
+ - name: Create Linux MUSL tarball
+ run: |
+ cd CommandLine/.temp/deploy
+ tar -czf ../../JustEnoughVCS_Linux_MUSL.tar.gz .
+
+ - name: Upload Linux MUSL artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: JustEnoughVCS_Linux_MUSL
+ path: CommandLine/JustEnoughVCS_Linux_MUSL.tar.gz
+ if-no-files-found: error