-
Notifications
You must be signed in to change notification settings - Fork 28
83 lines (72 loc) · 2.43 KB
/
sdk-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Zowe SDK Release
on:
workflow_dispatch:
inputs:
version:
description: Update project version before publish
required: false
type: string
dry-run:
description: Dry run mode
required: false
type: boolean
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Update version
id: update-version
shell: python
run: |
import os, sys
sys.path.append("src")
from _version import __version__
new_version = "${{ inputs.version }}"
if new_version:
with open("src/_version.py", 'w') as f:
f.write("__version__ = \"" + new_version + "\"\n")
else:
new_version = __version__
with open(os.environ["GITHUB_OUTPUT"], 'a') as f:
print("version=" + ("-".join(new_version.rsplit(".", 1)) if new_version.count(".") > 2 else new_version), file=f)
# - name: Update version (cargo)
# run: cargo install cargo-edit && cargo set-version ${{ steps.update-version.outputs.version }}
# working-directory: src/secrets
- name: Update version (git)
run: git add src/_version.py src/secrets/Cargo.*
- name: Build wheels
run: bash build.sh
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist/
- uses: zowe-actions/octorelease@v1
env:
GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }}
GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
GIT_CREDENTIALS: x-access-token:${{ secrets.ZOWE_ROBOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_ROBOT_TOKEN }}
with:
dry-run: ${{ inputs.dry-run }}
new-version: ${{ steps.update-version.outputs.version }}