-
Notifications
You must be signed in to change notification settings - Fork 1
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 #34 from phoenixnap/release/v1.3.0
Release/v1.3.0
- Loading branch information
Showing
57 changed files
with
962 additions
and
788 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,44 @@ | ||
name: (internal) - Build, Lint, Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package-name: | ||
required: true | ||
type: string | ||
test-file: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
lint: | ||
name: Lint ${{ inputs.package-name }} | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/workflows/composite/lint-sdk | ||
with: | ||
package-name: ${{ inputs.package-name }} | ||
test: | ||
name: Test ${{ inputs.package-name }} | ||
runs-on: ubuntu-18.04 | ||
needs: | ||
- lint | ||
services: | ||
mockserver: | ||
image: mockserver/mockserver:5.13.0 | ||
ports: | ||
- 1080:1080 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ '3.6', '3.11' ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/workflows/composite/test-sdk | ||
with: | ||
package-under-test: ./${{ inputs.package-name }} | ||
test-dir: tests | ||
test-file: ${{ inputs.test-file }} | ||
test-report-dir: tests/test-reports | ||
python-version: ${{ matrix.python-version }} |
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,23 @@ | ||
name: (internal) - Generate | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
spec-link: | ||
required: true | ||
type: string | ||
package-name: | ||
required: true | ||
type: string | ||
|
||
|
||
jobs: | ||
generate: | ||
name: Generate ${{ inputs.package-name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/workflows/composite/generate-sdk | ||
with: | ||
spec-link: ${{ inputs.spec-link }} | ||
package-name: ${{ inputs.package-name }} |
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,62 @@ | ||
name: (internal) - Publish | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package-name: | ||
required: true | ||
type: string | ||
secrets: | ||
PYPI_API_KEY: | ||
required: true | ||
|
||
jobs: | ||
check-release: | ||
name: Check Release | ||
runs-on: ubuntu-18.04 | ||
outputs: | ||
module: ${{ inputs.package-name }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Determining release type | ||
id: step1 | ||
run: | | ||
TAG=${{ github.ref }} | ||
IFS='/' read -r -a array <<< "${TAG#refs/*/}" | ||
if [ "${#array[@]}" -eq "2" ]; then | ||
PACKAGE=${array[0]} | ||
VERSION=${array[1]} | ||
echo Is subpackage release. Publishing $PACKAGE v$VERSION to registry. | ||
echo "package=$PACKAGE" >> $GITHUB_OUTPUT | ||
else | ||
echo Is main release. Skipping. | ||
fi | ||
publish-python-gems: | ||
name: Publish to Python Package Index | ||
if: needs.check-release.outputs.module != 0 | ||
runs-on: ubuntu-18.04 | ||
needs: check-release | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- uses: ./.github/workflows/composite/setup-python | ||
- name: "Install Dependencies for Packaging" | ||
run: | | ||
pip3 install twine | ||
pip3 install wheel | ||
pip3 install --requirement ${{ needs.check-release.outputs.package }}/requirements.txt | ||
- name: "Build Package" | ||
run: | | ||
cd ${{ needs.check-release.outputs.package }} | ||
python3 setup.py sdist bdist_wheel | ||
- name: "Publish Package" | ||
run: | | ||
cd ${{ needs.check-release.outputs.package }} | ||
twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_KEY }} |
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,99 @@ | ||
name: generate-all | ||
|
||
on: | ||
schedule: | ||
- cron: '15 */4 * * *' | ||
push: | ||
branches: | ||
- 'develop' | ||
- 'feature/**' | ||
- 'chore/**' | ||
- 'bugfix/**' | ||
- 'story/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prerequisite: | ||
name: Prerequisite for Generation | ||
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/feature') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Prerequisite | ||
run: | | ||
echo Prerequisites passed! | ||
generate-bmcapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/bmc/download_spec | ||
package-name: pnap_bmc_api | ||
generate-ranchersolutionapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/rancher/download_spec | ||
package-name: pnap_rancher_solution_api | ||
generate-networkapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/networks/download_spec | ||
package-name: pnap_network_api | ||
generate-ipapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/ips/download_spec | ||
package-name: pnap_ip_api | ||
generate-auditapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/bmc-audit/download_spec | ||
package-name: pnap_audit_api | ||
generate-tagapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/tags/download_spec | ||
package-name: pnap_tag_api | ||
generate-networkstorageapi: | ||
needs: prerequisite | ||
uses: ./.github/workflows/_generate.yml | ||
with: | ||
spec-link: https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/network-storage/download_spec | ||
package-name: pnap_network_storage_api | ||
|
||
# Push generated code | ||
push-changes: | ||
name: Push Changes | ||
runs-on: ubuntu-latest | ||
needs: | ||
- generate-bmcapi | ||
- generate-ranchersolutionapi | ||
- generate-networkapi | ||
- generate-ipapi | ||
- generate-auditapi | ||
- generate-tagapi | ||
- generate-networkstorageapi | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
- name: Move spec files | ||
run: | | ||
find . -type f -name "*.spec.yaml" -not -path "./specs/*" -print0 | xargs -0 mv -ft ./specs/ | ||
- name: Add and Commit files | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add -A | ||
if test "$(git status --porcelain=v1 2>/dev/null | wc -l)" -gt "0" ; then git commit -m "Add changes"; else echo No changes found; fi | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |
Oops, something went wrong.