From cc9c241154792e0451001e1077d0c2d485166b42 Mon Sep 17 00:00:00 2001 From: MAHDTech Date: Wed, 29 Mar 2023 01:52:28 +1100 Subject: [PATCH] ci: Update release workflow --- .github/workflows/release.yaml | 117 ++++++++++++++++++--- Cargo.toml | 3 + config/capi/kind/hostpath-provisioner.yaml | 10 ++ config/manifests/confluence/rbac.yaml | 2 +- config/manifests/confluence/secret.yaml | 2 +- 5 files changed, 120 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8f4c0bbe..0ace5a6a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -233,12 +233,6 @@ jobs: toolchain: ${{ matrix.toolchain }} default: true - - id: setup_rust_arm64 - name: Setup the Rust environment for ARM64 - if: matrix.target == 'aarch64-unknown-linux-gnu' && matrix.os == 'ubuntu-latest' - run: | - sudo apt install gcc-multilib - - id: checkout_repository name: Checkout repository uses: actions/checkout@v2 @@ -274,9 +268,70 @@ jobs: restore-keys: | ${{ matrix.target }}-target- + - id: cache_artifacts_vcpkg + name: Cache vcpkg + if: matrix.target == 'x86_64-pc-windows-msvc' && matrix.os == 'windows-latest' + uses: actions/cache@v2 + with: + path: vcpkg + key: ${{ matrix.target }}-vcpkg-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.target }}-vcpkg- + + - id: setup_rust_arm64 + name: Setup the Rust environment for ARM64 + if: matrix.target == 'aarch64-unknown-linux-gnu' && matrix.os == 'ubuntu-latest' + run: | + sudo apt install gcc-multilib + + - id: setup_rust_macos + name: Setup the Rust environment for MacOS + if: matrix.target == 'x86_64-apple-darwin' && matrix.os == 'macos-latest' + run: | + brew install libmagic openssl pkg-config bzip2 figlet file gnu-tar zlib zstd + + - id: setup_rust_windows + name: Setup the Rust environment for Windows + if: matrix.target == 'x86_64-pc-windows-msvc' && matrix.os == 'windows-latest' + shell: powershell + env: + VCPKG_INSTALLED: ${{ github.workspace }}/vcpkg/installed/ + #VCPKG_DEFAULT_TRIPLET: "x64-windows-static" # (libcmt.lib) + VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md" # (msvcrt.lib) + run: | + git clone https://github.com/microsoft/vcpkg.git + Push-Location -Path "vcpkg" + Start-Process ".\bootstrap-vcpkg.bat" + vcpkg.exe install curl:${env:VCPKG_DEFAULT_TRIPLET} libmagic:${env:VCPKG_DEFAULT_TRIPLET} openssl:${env:VCPKG_DEFAULT_TRIPLET} zlib:${env:VCPKG_DEFAULT_TRIPLET} + vcpkg.exe integrate install + Pop-Location + choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + tree /F ${env:VCPKG_INSTALLED} + - id: cargo_check name: Run Cargo check + if: matrix.target != 'x86_64-pc-windows-msvc' + run: | + cargo --version + cargo check --verbose + + - id: cargo_check_windows + name: Run Cargo check (Windows) + if: matrix.target == 'x86_64-pc-windows-msvc' && matrix.os == 'windows-latest' + shell: powershell + env: + VCPKGRS_DYNAMIC: "1" + VCPKG_ROOT: ${{ github.workspace }}\vcpkg + VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md" + VCPKG_INSTALLED: ${{ github.workspace }}\vcpkg\installed run: | + $env:LIBMAGIC_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_LIB_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib" + $env:OPENSSL_INCLUDE_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include" + $env:LIB = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib;$env:LIB" + $env:INCLUDE = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include;$env:INCLUDE" + $env:RUSTFLAGS = "-Ctarget-feature=+crt-static -L${env:LIBMAGIC_DIR}\lib" cargo --version cargo check --verbose @@ -296,19 +351,57 @@ jobs: cargo clippy --version cargo clippy --all --all-features -- -D warnings + - id: cargo_build + name: Run Cargo build + if: matrix.target != 'x86_64-pc-windows-msvc' + run: | + cargo --version + cargo build --verbose --release + + - id: cargo_build_windows + name: Run Cargo build (Windows) + if: matrix.target == 'x86_64-pc-windows-msvc' && matrix.os == 'windows-latest' + shell: powershell + env: + VCPKGRS_DYNAMIC: "1" + VCPKG_ROOT: ${{ github.workspace }}\vcpkg + VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md" + VCPKG_INSTALLED: ${{ github.workspace }}\vcpkg\installed + run: | + $env:LIBMAGIC_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_LIB_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib" + $env:OPENSSL_INCLUDE_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include" + $env:LIB = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib;$env:LIB" + $env:INCLUDE = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include;$env:INCLUDE" + $env:RUSTFLAGS = "-Ctarget-feature=+crt-static -L${env:LIBMAGIC_DIR}\lib" + cargo build --verbose --release + - id: cargo_test name: Run Cargo tests + if: matrix.target != 'x86_64-pc-windows-msvc' run: | cargo --version cargo test --verbose - - id: cargo_build - name: Run Cargo build + - id: cargo_test_windows + name: Run Cargo tests (Windows) + if: matrix.target == 'x86_64-pc-windows-msvc' && matrix.os == 'windows-latest' + shell: powershell + env: + VCPKGRS_DYNAMIC: "1" + VCPKG_ROOT: ${{ github.workspace }}\vcpkg + VCPKG_DEFAULT_TRIPLET: "x64-windows-static-md" + VCPKG_INSTALLED: ${{ github.workspace }}\vcpkg\installed run: | - rustup target add ${{ matrix.target }} - rustup target list --toolchain ${{ matrix.toolchain }} - cargo --version - cargo build --verbose --release --target=${{ matrix.target }} + $env:LIBMAGIC_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET" + $env:OPENSSL_LIB_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib" + $env:OPENSSL_INCLUDE_DIR = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include" + $env:LIB = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\lib;$env:LIB" + $env:INCLUDE = "$env:VCPKG_INSTALLED\$env:VCPKG_DEFAULT_TRIPLET\include;$env:INCLUDE" + $env:RUSTFLAGS = "-Ctarget-feature=+crt-static -L${env:LIBMAGIC_DIR}\lib" + cargo test --verbose - id: archive_rust name: Archive Rust artifacts (cross-platform) diff --git a/Cargo.toml b/Cargo.toml index 933d8359..0d268e0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,9 @@ name = "loopy" description = "Kubernetes packaging inner feedback loop." version = "0.1.0" edition = "2021" +license-file = "LICENSE" +homepage = "https://github.com/salt-labs/loopy" +documentation = "https://github.com/salt-labs/loopy" [dependencies] anyhow = "1.0" diff --git a/config/capi/kind/hostpath-provisioner.yaml b/config/capi/kind/hostpath-provisioner.yaml index 8bbd0b56..be4f6775 100644 --- a/config/capi/kind/hostpath-provisioner.yaml +++ b/config/capi/kind/hostpath-provisioner.yaml @@ -125,3 +125,13 @@ metadata: storageclass.kubernetes.io/is-default-class: "true" reclaimPolicy: Delete provisioner: example.com/hostpath + +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: vsan-default-storage-policy + annotations: + storageclass.kubernetes.io/is-default-class: "false" +reclaimPolicy: Delete +provisioner: example.com/hostpath diff --git a/config/manifests/confluence/rbac.yaml b/config/manifests/confluence/rbac.yaml index cd84a17b..7d8f4a96 100644 --- a/config/manifests/confluence/rbac.yaml +++ b/config/manifests/confluence/rbac.yaml @@ -47,7 +47,7 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: confluence-system-privileged - namespace: atlassian-confluence + namespace: confluence roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/config/manifests/confluence/secret.yaml b/config/manifests/confluence/secret.yaml index adab50cd..bf3c3e20 100644 --- a/config/manifests/confluence/secret.yaml +++ b/config/manifests/confluence/secret.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: credentials-db - namespace: atlassian-confluence + namespace: confluence data: password: ZGJfcGFzc3dvcmQ= username: ZGJfdXNlcm5hbWU=