-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #222 from zowe/feat/add-secrets-sdk
Add Secrets SDK with Rust keyring bindings
- Loading branch information
Showing
19 changed files
with
1,339 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Zowe SDK Release | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
if: ${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release-dev') }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
token: ${{ secrets.ZOWE_ROBOT_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Increment dev version | ||
id: update-version | ||
shell: python | ||
run: | | ||
import sys | ||
sys.path.append("src") | ||
from _version import __version__ | ||
prerelease_tag = "dev" | ||
tag_end_index = __version__.index(prerelease_tag) + len(prerelease_tag) | ||
new_version = __version__[:tag_end_index] + str(int(__version__[tag_end_index:]) + 1) | ||
with open("src/_version.py", 'w') as f: | ||
f.write("__version__ = \"" + new_version + "\"\n") | ||
print("::set-output name=version::" + new_version) | ||
print("::set-output name=cargo-version::" + "-".join(new_version.rsplit(".", 1))) | ||
- name: Increment dev version (cargo) | ||
run: cargo install cargo-edit && cargo set-version ${{ steps.update-version.outputs.cargo-version }} | ||
working-directory: src/secrets | ||
|
||
- name: Build dist wheels | ||
run: bash build.sh | ||
|
||
- name: Commit version update | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: "Bump version to ${{ steps.update-version.outputs.version }} [ci skip]" | ||
commit_options: "--signoff" | ||
commit_user_name: ${{ secrets.ZOWE_ROBOT_USER }} | ||
commit_user_email: ${{ secrets.ZOWE_ROBOT_EMAIL }} | ||
file_pattern: "src/_version.py src/secrets/Cargo.*" | ||
tagging_message: v${{ steps.update-version.outputs.version }} | ||
|
||
- name: Publish packages to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_ROBOT_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
# This file is autogenerated by maturin v1.3.1 | ||
# To update, run | ||
# | ||
# maturin generate-ci github | ||
# | ||
name: Secrets SDK CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/secrets/**" | ||
- ".github/workflows/secrets-sdk.yml" | ||
pull_request: | ||
paths: | ||
- "src/secrets/**" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64, x86, aarch64, armv7, s390x] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Set environment variables | ||
run: src/secrets/scripts/configure-cross.sh ${{ matrix.target }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --skip-auditwheel | ||
sccache: "true" | ||
manylinux: auto | ||
docker-options: -e PKG_CONFIG_SYSROOT_DIR -e PKG_CONFIG_PATH | ||
working-directory: src/secrets | ||
before-script-linux: | | ||
if command -v yum &> /dev/null; then | ||
yum update && yum install -y libsecret-devel.${{ env.CROSS_DEB_ARCH }} pkgconfig | ||
else | ||
dpkg --add-architecture ${{ env.CROSS_DEB_ARCH }} | ||
sed -i "s/deb /deb [arch=amd64] /g" /etc/apt/sources.list | ||
echo "deb [arch=${{ env.CROSS_DEB_ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy main universe" >> /etc/apt/sources.list | ||
echo "deb [arch=${{ env.CROSS_DEB_ARCH }}] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main universe" >> /etc/apt/sources.list | ||
apt-get update && apt-get install -y libsecret-1-dev:${{ env.CROSS_DEB_ARCH }} pkg-config | ||
fi | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: src/secrets/dist | ||
|
||
windows: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
target: [x64, x86, aarch64] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
if: ${{ matrix.target != 'aarch64' }} | ||
with: | ||
python-version: "3.10" | ||
architecture: ${{ matrix.target }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist | ||
sccache: "true" | ||
working-directory: src/secrets | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: src/secrets/dist | ||
|
||
macos: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64, aarch64] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist | ||
sccache: "true" | ||
working-directory: src/secrets | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: src/secrets/dist | ||
|
||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
working-directory: src/secrets | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: src/secrets/dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
needs: [linux, windows, macos, sdist] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
- name: Publish to PyPI | ||
uses: PyO3/maturin-action@v1 | ||
env: | ||
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_ROBOT_TOKEN }} | ||
with: | ||
command: upload | ||
args: --non-interactive --skip-existing * | ||
working-directory: src/secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.