From 7fb3793c54496e3f031ad296d2353753c67d8b61 Mon Sep 17 00:00:00 2001 From: Till Wegmueller Date: Sun, 18 Jan 2026 14:59:24 +0100 Subject: [PATCH] Remove Jenkinsfile, add Illumos builds to GitHub Actions, and document release process - Deleted the Jenkinsfile, transitioning all CI workflows to GitHub Actions. - Added Illumos (OpenIndiana) build and release steps to GitHub workflows. - Created a new release pipeline triggered by version tags starting with `v`. - Updated README with release instructions using `cargo-release`. --- .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 26 +++++++++++- Cargo.toml | 8 ++++ Jenkinsfile | 37 ----------------- README.md | 13 ++++++ 5 files changed, 122 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 Jenkinsfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..55691e7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build-illumos: + name: Build on Illumos (OpenIndiana) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build in OpenIndiana VM + uses: vmactions/openindiana-vm@v1 + with: + prepare: | + pkg install -v developer/lang/rustc build-essential jq + run: | + cargo build --release + mkdir -p artifacts + cp target/release/pkg6 artifacts/ + cp target/release/pkg6repo artifacts/ + cp target/release/pkg6depotd artifacts/ + tar czf ips-illumos-x86_64.tar.gz -C artifacts . + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ips-illumos-x86_64 + path: ips-illumos-x86_64.tar.gz + + build-linux: + name: Build on Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + - name: Build + run: | + cargo build --release + mkdir -p artifacts + cp target/release/pkg6 artifacts/ + cp target/release/pkg6repo artifacts/ + cp target/release/pkg6depotd artifacts/ + tar czf ips-linux-x86_64.tar.gz -C artifacts . + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ips-linux-x86_64 + path: ips-linux-x86_64.tar.gz + + create-release: + name: Create GitHub Release + needs: [build-illumos, build-linux] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Download Illumos Artifact + uses: actions/download-artifact@v4 + with: + name: ips-illumos-x86_64 + - name: Download Linux Artifact + uses: actions/download-artifact@v4 + with: + name: ips-linux-x86_64 + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + ips-illumos-x86_64.tar.gz + ips-linux-x86_64.tar.gz + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 43714b2..7861190 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -52,7 +52,7 @@ jobs: # Build the project build: - name: Build + name: Build (Linux) needs: [format, clippy] runs-on: ${{ matrix.os }} strategy: @@ -85,10 +85,32 @@ jobs: path: target/release/ retention-days: 1 + # Build on Illumos (OpenIndiana) + build-illumos: + name: Build (Illumos) + needs: [format, clippy] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build in OpenIndiana VM + uses: vmactions/openindiana-vm@v1 + with: + prepare: | + pkg install -v developer/lang/rustc build-essential jq + run: | + cargo run -p xtask -- build + cargo run -p xtask -- build -r + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ips-binaries-illumos + path: target/release/ + retention-days: 1 + # Run unit tests test: name: Test - needs: [build] + needs: [build, build-illumos] runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/Cargo.toml b/Cargo.toml index 12bca4a..e7762a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,3 +21,11 @@ repository = "https://github.com/OpenFlowLabs/ips" readme = "README.md" keywords = ["packaging", "illumos"] authors = ["Till Wegmueller "] + +[workspace.metadata.release] +push = false +tag = true +pre-release-commit-message = "chore: Release {{version}}" +tag-message = "chore: Release {{version}}" +consolidate-commits = true +shared-version = true diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 12d5d8b..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,37 +0,0 @@ -// This Jenkinsfile is only used for illumos builds. -// For all other CI workflows, GitHub Actions is used (see .github/workflows/rust.yml) -pipeline { - agent { - node { - label 'buildserver' - } - } - - options { - buildDiscarder logRotator( - daysToKeepStr: '1', - numToKeepStr: '3' - ) - } - - stages { - stage('Build') { - steps { - sh ''' - source $HOME/.profile - cargo version - cargo build - ''' - } - } - stage('Test') { - steps { - sh ''' - source $HOME/.profile - cargo version - cargo test - ''' - } - } - } -} diff --git a/README.md b/README.md index 5e1513d..48b8cce 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,16 @@ but some things have been added over the years which has not been properly docum but be advised, this is mainly intended for use within the illumos community and it's distributions. Big changes which are not in the current IPS will need to be carefully coordinated to not break the current IPS. + +## Development and Release + +### Releasing + +This project uses `cargo-release` for versioning and tagging. + +1. Ensure you have `cargo-release` installed: `cargo install cargo-release` +2. Prepare the release (dry-run): `cargo release [level] --dry-run` (e.g., `cargo release patch --dry-run`) +3. Execute the release: `cargo release [level] --execute` +4. Push the changes and tags: `git push --follow-tags` + +Pushing a tag starting with `v` (e.g., `v0.5.1`) will trigger the GitHub Actions release pipeline, which builds artifacts for Illumos (OpenIndiana) and Linux, and creates a GitHub Release.