Skip to content

Commit

Permalink
Merge pull request #1114 from zowe/next-zowex-is-zowe
Browse files Browse the repository at this point in the history
Next zowex is zowe
  • Loading branch information
gejohnston authored Nov 11, 2021
2 parents 46b899e + 705c1bf commit d2535d1
Show file tree
Hide file tree
Showing 9 changed files with 1,208 additions and 552 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/rust-cli-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Create Archive
run: |
cd target/release
tar -cvzf zowex.tgz zowex
tar -cvzf zowe.tgz zowe
- name: Upload Release Asset
id: upload-release-asset
Expand All @@ -96,8 +96,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: target/release/zowex.tgz
asset_name: zowex-linux.tgz
asset_path: target/release/zowe.tgz
asset_name: zowe-linux.tgz
asset_content_type: application/octet-stream


Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Create Archive
run: |
cd target/release
tar -cvzf zowex.tgz zowex
tar -cvzf zowe.tgz zowe
- name: Upload Release Asset
id: upload-release-asset
Expand All @@ -135,8 +135,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: target/release/zowex.tgz
asset_name: zowex-macos.tgz
asset_path: target/release/zowe.tgz
asset_name: zowe-macos.tgz
asset_content_type: application/octet-stream


Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
- name: Create Archive
run: |
cd target/release
tar -cvzf zowex.tgz zowex.exe
tar -cvzf zowe.tgz zowe.exe
- name: Upload Release Asset
id: upload-release-asset
Expand All @@ -174,6 +174,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: target\release\zowex.tgz
asset_name: zowex-windows.tgz
asset_path: target\release\zowe.tgz
asset_name: zowe-windows.tgz
asset_content_type: application/octet-stream
84 changes: 78 additions & 6 deletions .github/workflows/rust-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,94 @@ name: Rust CLI CI
on:
push:
branches-ignore:
- "master"
- "next"
paths: "zowex/**"
- "master"
- "next"
paths:
- "zowex/**"
- '.github/workflows/rust-cli*.yml'
pull_request:
paths: "zowex/**"

jobs:
build:

build-linux:
name: Build Linux
runs-on: ubuntu-latest

# Need to build in container with old version of GLIBC to support RHEL 7
# https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-ci-that-work-with-older-glibc.html
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build
run: cargo build --verbose --manifest-path=zowex/Cargo.toml

- name: Create Archive
run: |
cd zowex/target/debug
tar -cvzf zowe.tgz zowe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v2
with:
name: zowe-linux.tgz
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml

build-macos:
name: Build MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Build
run: cargo build --verbose --manifest-path=zowex/Cargo.toml

- name: Create Archive
run: |
cd zowex/target/debug
tar -cvzf zowe.tgz zowe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v2
with:
name: zowe-macos.tgz
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml

build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: Build
run: cargo build --verbose --manifest-path=zowex/Cargo.toml

- name: Create Archive
run: |
cd zowex/target/debug
tar -cvzf zowe.tgz zowe.exe
- name: Archive Results
id: upload
uses: actions/upload-artifact@v2
with:
name: zowe-windows.tgz
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml
run: cargo test --verbose --manifest-path=zowex/Cargo.toml
14 changes: 14 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ node('zowe-jenkins-agent-dind') {
header: "## Recent Changes"
)

pipeline.createStage(
name: "Bundle Daemon Binaries",
shouldExecute: {
return pipeline.protectedBranches.isProtected(BRANCH_NAME)
},
timeout: [time: 10, unit: 'MINUTES'],
stage: {
def daemonVer = readProperties(file: "zowex/Cargo.toml").version
withCredentials([usernamePassword(credentialsId: 'zowe-robot-github', usernameVariable: 'USERNAME', passwordVariable: 'TOKEN')]) {
sh "bash jenkins/bundleDaemon.sh ${daemonVer} \"${USERNAME}:${TOKEN}\""
}
}
)

pipeline.createStage(
name: "Bundle Keytar Binaries",
shouldExecute: {
Expand Down
23 changes: 23 additions & 0 deletions jenkins/bundleDaemon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Usage: bash bundleDaemon.sh <daemonVersion> [githubAuthHeader]
set -ex

daemonVersion=$1
githubAuthHeader=$2

until [[ $(curl -fs https://$githubAuthHeader@api.github.com/repos/zowe/zowe-cli/releases/tags/native-v$daemonVersion |
jq -r '.assets | length') == "3" ]]; do
echo "Waiting for Rust CLI Publish workflow to complete..."
sleep 30
done

cd "$(git rev-parse --show-toplevel)"
rm -rf prebuilds
mkdir prebuilds && cd prebuilds

for platform in linux macos windows; do
curl -fsLOJ https://github.com/zowe/zowe-cli/releases/download/native-v$daemonVersion/zowe-$platform.tgz
done

cd ..
mv prebuilds packages/cli/
Loading

0 comments on commit d2535d1

Please sign in to comment.