diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 654f59f..ece6516 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: os: ["ubuntu-latest", "windows-latest", "macos-latest"] python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ${{ matrix.os }} - timeout-minutes: 5 + timeout-minutes: 15 needs: - lint - typecheck diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8db5a10 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +--- +name: Release +# yamllint disable-line rule:truthy +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-slim + timeout-minutes: 5 + environment: release + permissions: + contents: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Setup UV + uses: astral-sh/setup-uv@v7 + - name: Detect version change + id: version-check + run: | + awk '{ + if ($1 == "version") { + gsub("\"", "", $3); + print $3; + } + }' pyproject.toml > .package-version + + VERSION="$(cat .package-version)" + if git rev-parse "v${VERSION}" > /dev/null 2>&1 ; then + NEW_VERSION=false + else + NEW_VERSION=true + fi + + { + echo "VERSION=${VERSION}" + echo "NEW_VERSION=${NEW_VERSION}" + } >> "$GITHUB_OUTPUT" + - name: Build and publish + if: steps.version-check.outputs.NEW_VERSION == 'true' + run: | + uv build + uv publish + - name: Create GitHub release + if: steps.version-check.outputs.NEW_VERSION == 'true' + uses: softprops/action-gh-release@v3 + with: + tag_name: v${{ steps.version-check.outputs.VERSION }} + generate_release_notes: true + files: dist/* diff --git a/pyproject.toml b/pyproject.toml index 4b794a9..d9bd075 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,8 @@ name = "arcticsecurity" version = "0.1.0" authors = [ - {name = "Arctic Security", email = "pypi@arcticsecurity.com"}, ] + {name = "Arctic Security", email = "pypi@arcticsecurity.com"}, +] description = "Library to access Arctic Security APIs" license = "MIT" license-files = ["LICENSE"]