Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,26 @@ on:
branches:
- main

permissions:
contents: read

jobs:
release-change:
name: Detect release merge
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.release.outputs.is-release }}
steps:
- uses: compas-dev/compas-actions/release-check@v1
id: release

build:
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
needs: release-change
if: github.event_name == 'pull_request' || needs.release-change.outputs.is-release != 'true'
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions.build@v5
- uses: compas-dev/compas-actions/ci@v1
with:
python: "3.11"
invoke_lint: true
invoke_test: true
python-version: "3.11"
management-tool: uv
invoke-tasks: lint test
14 changes: 4 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
name: docs

on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main

permissions:
contents: write
contents: read

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions.docs@v5
- uses: compas-dev/compas-actions/docs@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
python: "3.11"
generator: mkdocs
python-version: "3.11"
extras: dev
strict: false
20 changes: 13 additions & 7 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ on:
branches:
- main

permissions:
contents: read

jobs:
release:
name: Validate release metadata
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions/release-check@v1

changelog:
name: Changelog check
name: Check changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Zomzog/changelog-checker@v1.2.0
- uses: compas-dev/compas-actions/pr-checks@v1
with:
fileName: CHANGELOG.md
checkNotification: Simple
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
changelog-path: CHANGELOG.md
skip-label: no changelog
26 changes: 26 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: prepare release

on:
workflow_dispatch:
inputs:
release-type:
description: Semantic version component to bump
required: true
type: choice
options:
- patch
- minor
- major

permissions:
contents: write
pull-requests: write

jobs:
release-pr:
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions/release-pr@v1
with:
release-type: ${{ inputs.release-type }}
github-token: ${{ github.token }}
92 changes: 61 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,89 @@ name: release

on:
push:
tags:
- "v*"
branches:
- main

permissions:
contents: read

jobs:
release:
name: Detect release merge
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.release.outputs.is-release }}
version: ${{ steps.release.outputs.version }}
tag: ${{ steps.release.outputs.tag }}
steps:
- uses: compas-dev/compas-actions/release-check@v1
id: release

build:
name: build distributions
needs: release
if: needs.release.outputs.is-release == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: compas-dev/compas-actions.build@v5
- uses: compas-dev/compas-actions/ci@v1
with:
invoke_lint: true
invoke_test: true
python: "3.11"

- name: Build distributions
run: python -m build
python-version: "3.11"
management-tool: uv
invoke-tasks: lint test

- name: Upload distributions
uses: actions/upload-artifact@v4
prepare:
needs: [release, build]
if: needs.release.outputs.is-release == 'true'
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions/prepare-release@v1
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
python-version: "3.11"
management-tool: uv

publish:
name: publish to PyPI
needs: build
needs: [release, prepare]
if: needs.release.outputs.is-release == 'true'
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/compas-threejs
permissions:
contents: read
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v4
- name: Download package distributions
uses: actions/download-artifact@v8.0.1
with:
name: python-package-distributions
path: dist/
path: dist

- name: Publish distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.14.2

github-release:
name: create GitHub release
needs: publish
create-release:
needs: [release, publish]
if: needs.release.outputs.is-release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --generate-notes --title "$GITHUB_REF_NAME"
- uses: compas-dev/compas-actions/github-release@v1
with:
github-token: ${{ github.token }}
tag-name: ${{ needs.release.outputs.tag }}
target: ${{ github.sha }}

docs:
needs: [release, create-release]
if: needs.release.outputs.is-release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: compas-dev/compas-actions/docs@v1
with:
deploy: true
version: ${{ needs.release.outputs.version }}
python-version: "3.11"
extras: dev
strict: false
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Migrated CI, documentation, and trusted publishing to `compas-actions@v1` and repository-owned release pull requests
- Transferred project ownership and copyright to the COMPAS Association
- Updated the bundled TypeScript viewer to the current public-release build
- Made the default physical-material attenuation distance JSON-safe
Expand Down
Loading