Skip to content

Commit

Permalink
new actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jziolkowski committed Dec 26, 2023
1 parent e97d572 commit b581450
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Shared Build Workflow

on:
workflow_call:
inputs:
pypi_token:
required: true
type: secret

jobs:
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8 (64-bit)
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build Python wheel
run: python -m build --outdir dist/
- name: Upload Python wheel to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ inputs.pypi_token }}
repository_url: https://test.pypi.org/legacy/

build-binaries:
needs: build-wheel
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
arch: x86
- os: windows-2019
arch: x64
- os: macos-latest
arch: x64
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: ${{ matrix.arch }}
- name: Install PyInstaller
run: pip install pyinstaller

- name: Build with PyInstaller
run: pyinstaller --noconfirm --clean tdmgr.spec

- name: Upload binaries artifact to workflow
uses: actions/upload-artifact@v2
with:
path: dist/*
36 changes: 36 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Develop Branch Workflow

on:
push:
branches:
- cicd_update
workflow_dispatch:

permissions:
contents: read
secrets: read

jobs:
call-shared-workflow:
uses: ./.github/workflows/build.yml
with:
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}

upload-assets:
needs: call-shared-workflow
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ASSETS_PRIVATE_KEY }}

- name: Download artifacts from build
uses: actions/download-artifact@v2
with:
path: dist

- name: Upload assets via SCP
run: |
scp -P ${{ secrets.ASSETS_PORT }} -o StrictHostKeyChecking=no -r dist/* ${{ secrets.ASSETS_USER }}@${{ secrets.ASSETS_HOST }}:/tdmgr/
shell: bash
File renamed without changes.

0 comments on commit b581450

Please sign in to comment.