Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
ci(workflows): reviewed workflow files to use reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AsifNawaz-cnic committed Apr 5, 2024
1 parent 63c8828 commit 9165832
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 265 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/auto-merge-dependabot-pr.yml

This file was deleted.

195 changes: 2 additions & 193 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,198 +4,7 @@ on:
branches:
- master

env:
PYTHON_MIN_VERSION: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}

jobs:
build:
name: Build
uses: ./.github/workflows/test.yml
secrets: inherit
permissions:
contents: read

generate-linux-bin:
permissions:
contents: write
deployments: write
name: Generate Linux bin
needs: build
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags.
- name: Checkout python
uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}
- name: Install python dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -e .
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: '${{ vars.RTLDEV_MW_CI_NODE_VERSION }}'
check-latest: true
cache: npm
- name: Install NodeJS dependencies
run: npm ci
- name: Release - version update only
run: |
echo '{"plugins": ["@semantic-release/commit-analyzer", ["@semantic-release/exec", { "verifyReleaseCmd": "./updateVersion.sh ${nextRelease.version}" }]]}' > '.releaserc.json'
cat .releaserc.json
npx semantic-release --dry-run
- name: Run Pyinstaller
run: |
"./scripts/linux-pyinstaller.sh"
- name: Upload linux-binary
uses: actions/upload-artifact@v4
with:
name: linux-binary
path: linux-binary-latest.zip
retention-days: 1
generate-macos-bin:
name: Generate MacOS bin
runs-on: macos-latest
needs: build
permissions:
contents: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags.
- name: Checkout python
uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -e .
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: '${{ vars.RTLDEV_MW_CI_NODE_VERSION }}'
check-latest: true
cache: npm
- name: Install NodeJS dependencies
run: npm ci
- name: Release - version update only
run: |
echo '{"plugins": ["@semantic-release/commit-analyzer", ["@semantic-release/exec", { "verifyReleaseCmd": "./updateVersionMacOS.sh ${nextRelease.version}" }]]}' > '.releaserc.json'
cat .releaserc.json
npx semantic-release --dry-run
- name: Run Pyinstaller
run: |
"./scripts/macos-pyinstaller.sh"
- name: Upload macos-binary
uses: actions/upload-artifact@v4
with:
name: macos-binary
path: macos-binary-latest.zip
retention-days: 1

generate-win-bin:
name: Generate Win bin
runs-on: windows-latest
needs: build
permissions:
contents: write
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags.
- name: Checkout python
uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}
- name: Install python dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -e .
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: '${{ vars.RTLDEV_MW_CI_NODE_VERSION }}'
check-latest: true
cache: npm
- name: Install NodeJS dependencies
run: npm ci
- name: Release - version update only
run: |
echo '{"plugins": ["@semantic-release/commit-analyzer", ["@semantic-release/exec", { "verifyReleaseCmd": "Bash updateVersion.sh ${nextRelease.version}" }]]}' > '.releaserc.json'
cat .releaserc.json
npx semantic-release --dry-run
- name: Run Pyinstaller
run: |
& "./scripts/win-pyinstaller.ps1"
- name: Upload win-binary
uses: actions/upload-artifact@v4
with:
name: win-binary
path: win-binary-latest.zip
retention-days: 1

release:
name: Release Job
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
needs:
- generate-linux-bin
- generate-macos-bin
- generate-win-bin
permissions:
contents: write
issues: write
deployments: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Number of commits to fetch. 0 indicates all history for all branches and tags.
persist-credentials: false
- name: Checkout python
uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install --upgrade pip testresources setuptools wheel
pip -V
pip install --upgrade -e .
- name: Setup NodeJS LTS
uses: actions/setup-node@v4
with:
node-version: '${{ vars.RTLDEV_MW_CI_NODE_VERSION }}'
check-latest: true
cache: npm
- name: Install dependencies
run: |
npm ci
gulp validate
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }}
COMMIT_SHA: ${{ github.sha }}
run: npx semantic-release
uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/ispapicli-release.yml@main
secrets: inherit
45 changes: 8 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
name: Linting & Coverage
name: Dependabot auto-merge & tests
on:
workflow_call:
pull_request:
types:
- opened
- synchronize

jobs:
test:
name: 🧪 Linting & Testing
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v5
with:
check-latest: true
python-version: ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip -V
pip install --upgrade -e .
- name: Python version
run: |
echo "Python version: "
echo ${{ vars.RTLDEV_MW_CI_PYTHON_VERSION }} | sed 's/./&‎/g'
- name: Super Linter Code Base
uses: github/super-linter/slim@v5
env:
FILTER_REGEX_INCLUDE: "/hexonet/*|/scripts/*|updateVersion*.sh|setup.py"
DEFAULT_BRANCH: master
VALIDATE_PYTHON_BLACK: true
VALIDATE_BASH: true
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coverage Report
run: "./scripts/coverage.sh"
tests:
uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/ispapicli-test.yml@main
secrets: inherit

0 comments on commit 9165832

Please sign in to comment.