diff --git a/.circleci/config.yml b/.circleci/config.yml index 7470543d9..e8701d01d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,11 +23,6 @@ orbs: github-cli: circleci/github-cli@2.6.2 slack: circleci/slack@5.1.1 - - - - - commands: install-lfs: steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf1bfd271..7fe537287 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,21 +3,31 @@ name: Upload Python Package on: push: tags: - - v*.** + - v* + branches: + - develop + pull_request: + branches: + - develop workflow_dispatch: permissions: contents: read jobs: - build_wheels: + build-wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest-8, macos-latest] + os: [ubuntu-latest, macos-latest] steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -33,9 +43,9 @@ jobs: git branch git fetch --depth=1 origin +refs/tags/*:refs/tags/* + # TODO: add cbuildwheel cache - name: Build release distributions - run: | - uv build --wheel + run: uv build --wheel env: HATCH_BUILD_HOOKS_ENABLE: true @@ -45,10 +55,9 @@ jobs: path: dist/ release: - needs: build_wheels - runs-on: ubuntu-latest-8 - permissions: - contents: write + if: startsWith(github.ref, 'refs/tags/') + needs: build-wheels + runs-on: ubuntu-latest environment: release steps: - uses: actions/checkout@v4 @@ -56,13 +65,6 @@ jobs: - name: Setup backend uses: ./.github/actions/setup-backend - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-1 - - name: Download All Artifacts uses: actions/download-artifact@v4 with: @@ -70,82 +72,15 @@ jobs: merge-multiple: true pattern: wheels-* + - name: Release PyPI + run: | + export UV_PUBLISH_PASSWORD="${{ secrets.PYPI_TOKEN }}" + export UV_PUBLISH_USERNAME="__token__" + uv publish --publish-url https://upload.pypi.org/legacy/ --keyring-provider disabled + - name: Make github release uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') with: files: dist/* fail_on_unmatched_files: true generate_release_notes: true - - - name: Publish message to slack - uses: slackapi/slack-github-action@v2.0.0 - if: success() && startsWith(github.ref, 'refs/tags/') - with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - webhook-type: incoming-webhook - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "✅ New codegen-sdk Release Successfully Published! 🚀", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Version:* ${{ github.ref_name }}\n*Released by:* <${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}>\n\n*Links:*\n• <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|GitHub Release>\n• " - } - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "" - } - ] - } - ] - } - - - name: Publish failed message to slack - uses: slackapi/slack-github-action@v2.0.0 - if: failure() && startsWith(github.ref, 'refs/tags/') - with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} - webhook-type: incoming-webhook - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "❌ codegen-sdk Release Failed", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Version:* ${{ github.ref_name }}\n*Attempted by:* <${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}>\n\n*Details:*\n• Failed to publish version ${{ github.ref_name }}\n• <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>" - } - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "Failed at " - } - ] - } - ] - }