diff --git a/.github/workflows/ci-bcf-pypi.yml b/.github/workflows/ci-bcf-pypi.yml new file mode 100644 index 0000000000..ae0a3a8900 --- /dev/null +++ b/.github/workflows/ci-bcf-pypi.yml @@ -0,0 +1,57 @@ +name: ci-bcf-pypi + +on: + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # * * * * * + - cron: "0 0 18 * *" + push: + paths: + - '.github/workflows/ci-bcf-pypi.yml' + workflow_dispatch: + +env: + major: 0 + minor: 0 + name: ifcopenshell + +jobs: + activate: + runs-on: ubuntu-latest + if: | + github.repository == 'IfcOpenShell/IfcOpenShell' + steps: + - name: Set env + run: echo ok go + + build: + needs: activate + name: ${{ matrix.config.name }}-${{ matrix.pyver }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 # https://github.com/actions/checkout + - uses: actions/setup-python@v2 # https://github.com/actions/setup-python + with: + python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - run: echo ${{ env.DATE }} + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%y%m%d')" + - name: Compile + run: | + pip install build + cd src/bcf && + python -m build + - name: Publish a Python distribution to PyPI + uses: ortega2247/pypi-upload-action@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: src/bcf/dist diff --git a/.github/workflows/ci-bcf.yml b/.github/workflows/ci-bcf.yml deleted file mode 100644 index 2d82036975..0000000000 --- a/.github/workflows/ci-bcf.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: ci-bcf - -on: - push: - -jobs: - activate: - runs-on: ubuntu-latest - if: | - github.repository == 'IfcOpenShell/IfcOpenShell' && - contains(github.event.head_commit.message, '[bcf release]') - steps: - - run: echo ok go - upload: - needs: activate - name: Upload BCF package to Pypi - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - name: Build package - run: | - cd src/bcf - pip install build - python -m build - - name: Test - run: | - cd src/bcf - make test - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} - packages_dir: src/bcf/dist