test gh deploy 2 #3
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
| on: | ||
| push: | ||
| tags: | ||
| - * | ||
| #should we prevent main branch build? | ||
| #branches: | ||
| # - "r2.9.2" | ||
| jobs: | ||
| #generated by gemini | ||
| create_release_tag: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| - name: Create Release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the default GITHUB_TOKEN | ||
| run: | | ||
| TAG=${GITHUB_REF#refs/tags/} # Extract the tag name from the ref | ||
| gh release create "$TAG" \ | ||
| --draft \ | ||
| --title "Release $TAG" \ | ||
| --notes "Automated release for $TAG." \ | ||
| --generate-notes # Automatically generate release notes based on commits | ||
| echo "Release $TAG created successfully." | ||
| build: | ||
| needs: create_release_tag | ||
| strategy: | ||
| # also support macos, linux arm64 | ||
| matrix: | ||
| os: [ubuntu-24.04] | ||
| #os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14] | ||
| runs-on: ${{matrix.os}} | ||
| # handle the fact we only want to build/name on tags | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| # TODO: use specific submodules for platform | ||
| with: | ||
| submodules: true | ||
| - name: build ${{ runner.os }} ${{ runner.arch }} | ||
| # TODO: make sure each part is built with the proper concurrency | ||
| #echo "RUNNER OS" "$RUNNER_OS" "${{ runner.os }}" "$RUNNER_ARCH" "${{ runner.arch }}" | ||
| run: | | ||
| if [ "$RUNNER_OS" == "Linux" ]; then | ||
| bash ./scripts/build_docker_manylinux_2_28.sh test_tag; | ||
| elif [ "$RUNNER_OS" == "macOS" ]; then | ||
| bash ./scripts/build_macos.sh test_tag; | ||
| else | ||
| echo "$RUNNER_OS not supported" | ||
| exit 1 | ||
| fi | ||
| - name: Upload Release Asset ${{ runner.os }} ${{ runner.arch }} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| TAG=${GITHUB_REF#refs/tags/} | ||
| gh release upload "$TAG" dist/*.whl | ||
| echo "Asset uploaded to release $TAG." | ||