wip for testing #59
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Run uv build - main package | |
| uses: ./.github/actions/uv-build | |
| with: | |
| dist_dir: "${{ runner.temp }}/dist/rogue-ai" | |
| - name: Run uv build - sdk package | |
| uses: ./.github/actions/uv-build | |
| with: | |
| workdir: "sdks/python" | |
| dist_dir: "${{ runner.temp }}/dist/rogue-ai-sdk" | |
| - name: Build tui | |
| uses: ./.github/actions/tui-build | |
| with: | |
| build_all: "true" | |
| build_dir: "${{ runner.temp }}/dist/rogue-tui" | |
| # Upload each artifact separately | |
| - name: Upload main package artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rogue-ai-package | |
| path: ${{ runner.temp }}/dist/rogue-ai | |
| retention-days: 90 | |
| - name: Upload SDK package artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rogue-ai-sdk-package | |
| path: ${{ runner.temp }}/dist/rogue-ai-sdk | |
| retention-days: 90 | |
| - name: Upload TUI artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rogue-tui-package | |
| path: ${{ runner.temp }}/dist/rogue-tui | |
| retention-days: 90 | |
| publish_rogue_ai_sdk: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: read | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download SDK package artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rogue-ai-sdk-package | |
| path: ./dist/rogue-ai-sdk | |
| # - name: Prepare Pypi release - sdk package | |
| # id: prepare_pypi_sdk | |
| # uses: ./.github/actions/prepare-pypi | |
| # with: | |
| # dist_dir: "./dist/rogue-ai-sdk" | |
| # package_name: "rogue-ai-sdk" | |
| # workdir: "sdks/python" | |
| # - name: Publish to PyPI - sdk package | |
| # if: steps.prepare_pypi_sdk.outputs.version_exists == 'false' | |
| # uses: pypa/gh-action-pypi-publish@release/v1 | |
| # env: | |
| # name: "pypi" | |
| # url: "https://pypi.org/p/rogue-ai-sdk" | |
| # with: | |
| # packages-dir: "./dist/rogue-ai-sdk" | |
| publish_rogue_ai: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: read | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download main package artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rogue-ai-package | |
| path: ./dist/rogue-ai | |
| # - name: Prepare Pypi release - main package | |
| # id: prepare_pypi_main | |
| # uses: ./.github/actions/prepare-pypi | |
| # with: | |
| # dist_dir: "./dist/rogue-ai" | |
| # package_name: "rogue-ai" | |
| # - name: Publish to PyPI - main package | |
| # if: steps.prepare_pypi_main.outputs.version_exists == 'false' | |
| # uses: pypa/gh-action-pypi-publish@release/v1 | |
| # env: | |
| # name: "pypi" | |
| # url: "https://pypi.org/p/rogue-ai" | |
| # with: | |
| # packages-dir: "./dist/rogue-ai" | |
| create_github_release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - publish_rogue_ai | |
| - publish_rogue_ai_sdk | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download main package artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rogue-ai-package | |
| path: ./dist/rogue-ai-package | |
| - name: Download SDK package artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rogue-ai-sdk-package | |
| path: ./dist/rogue-ai-sdk-package | |
| - name: Download TUI artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rogue-tui-package | |
| path: ./dist/rogue-tui-package | |
| - name: Check if release exists | |
| id: check_release | |
| run: | | |
| if gh release view ${{ github.ref_name }} >/dev/null 2>&1; then | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.check_release.outputs.exists == 'false' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ./dist/rogue-ai-package/* | |
| ./dist/rogue-ai-sdk-package/* | |
| ./dist/rogue-tui-package/* | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Attach files to existing GitHub Release | |
| if: steps.check_release.outputs.exists == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ./dist/rogue-ai-package/* | |
| ./dist/rogue-ai-sdk-package/* | |
| ./dist/rogue-tui-package/* | |
| tag_name: ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |