work on windows build5 #14
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" | |
| #TODO: handle common code in build steps | |
| jobs: | |
| #generated by gemini | |
| create_release_tag: | |
| runs-on: ubuntu-latest | |
| # TODO: may need to be reenabled to create a release | |
| #permissions: | |
| # contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: false | |
| - 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_windows: | |
| name: Build on Windows | |
| runs-on: windows-2025 | |
| needs: create_release_tag | |
| steps: | |
| - name: set git crlf | |
| run: git config --global core.autocrlf input | |
| - name: Set tags and variables | |
| shell: bash | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| echo "README_BASE_URL=\"https://github.com/devsim/devsim/blob/${TAG}\"" >> $GITHUB_ENV | |
| echo "PLATFORM=x64" >> $GITHUB_ENV | |
| echo "CONDA_BIN=c:\\${CONDA}\\condabin\\conda.bat" >> $GITHUB_ENV | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| # TODO: use specific submodules for platform | |
| with: | |
| submodules: true | |
| # call build | |
| - name: compilation | |
| shell: cmd | |
| run: | | |
| scripts\build_appveyor.bat %PLATFORM% %CONDA_BIN% %TAG% | |
| # deploy artifact | |
| - name: Upload Release Asset ${{ runner.os }} ${{ runner.arch }} | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload "$TAG" dist/*.whl | |
| echo "Asset uploaded to release $TAG." | |
| build_linux: | |
| # todo: common code refactor | |
| if: false | |
| 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: Set tag | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| echo "README_BASE_URL=\"https://github.com/devsim/devsim/blob/${TAG}\"" >> $GITHUB_ENV | |
| - 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: | | |
| gh release upload "$TAG" dist/*.whl | |
| echo "Asset uploaded to release $TAG." |