First commit! #8
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: Build and Update | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - '**.rs' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '.github/workflows/**' | |
| pull_request: | |
| paths: | |
| - '**.rs' | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| - '.github/workflows/**' | |
| jobs: | |
| alpine: | |
| uses: ./.github/workflows/alpine_build.yml | |
| with: | |
| ring-version: master | |
| freebsd: | |
| uses: ./.github/workflows/freebsd_build.yml | |
| with: | |
| ring-version: master | |
| macos: | |
| uses: ./.github/workflows/macos_build.yml | |
| with: | |
| ring-version: master | |
| ubuntu: | |
| uses: ./.github/workflows/ubuntu_build.yml | |
| with: | |
| ring-version: master | |
| windows: | |
| uses: ./.github/workflows/windows_build.yml | |
| with: | |
| ring-version: master | |
| update-libs: | |
| runs-on: ubuntu-latest | |
| needs: [ alpine, freebsd, macos, ubuntu, windows ] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts from this workflow run | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Copy artifacts to lib directory | |
| run: | | |
| mkdir -p lib | |
| echo "=== Artifacts structure ===" | |
| find artifacts -type f | |
| echo "=== Copying artifacts ===" | |
| # Each artifact is named ring-python-{os}-{arch} and contains a single binary | |
| for artifact_dir in artifacts/ring-python-*/; do | |
| dirname=$(basename "$artifact_dir") | |
| # Extract os and arch from ring-python-{os}-{arch} | |
| os_arch="${dirname#ring-python-}" | |
| os="${os_arch%-*}" | |
| os="${os//-//}" | |
| arch="${os_arch##*-}" | |
| mkdir -p "lib/${os}/${arch}" | |
| echo "Copying ${os}/${arch} from: $artifact_dir" | |
| cp -a "${artifact_dir}"* "lib/${os}/${arch}/" | |
| done | |
| echo "=== Final lib structure ===" | |
| find lib -type f | |
| - name: Commit and push changes | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add lib | |
| if ! git diff --staged --quiet; then | |
| git commit -m "* Update libs" | |
| git push | |
| else | |
| echo "No library changes to commit." | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |