|
| 1 | +--- |
| 2 | +name: macOS build - buf edition |
| 3 | +on: [push] |
| 4 | +defaults: |
| 5 | + run: |
| 6 | + shell: bash |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: macos-13 |
| 11 | + |
| 12 | + permissions: |
| 13 | + contents: write |
| 14 | + |
| 15 | + strategy: |
| 16 | + fail-fast: true |
| 17 | + matrix: |
| 18 | + go-version: [1.24.x] |
| 19 | + python3_version: [ "3.11", "3.12", "3.13" ] |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Setup Go |
| 25 | + uses: actions/setup-go@v4 |
| 26 | + with: |
| 27 | + go-version: ${{ matrix.go-version }} |
| 28 | + cache-dependency-path: go.sum |
| 29 | + |
| 30 | + # - name: Set up Python |
| 31 | + # uses: actions/setup-python@v4 |
| 32 | + # with: |
| 33 | + # python-version: ${{ matrix.python3_version }} |
| 34 | + |
| 35 | + - name: Install the latest version of uv |
| 36 | + uses: astral-sh/setup-uv@v6 |
| 37 | + with: |
| 38 | + version: "latest" |
| 39 | + python-version: ${{ matrix.python3_version }} |
| 40 | + |
| 41 | + # Download a release like https://github.com/bufbuild/buf/releases/download/v1.53.0/buf-Linux-x86_64 |
| 42 | + - name: Install buf |
| 43 | + run: | |
| 44 | + BUF_VERSION="1.53.0" |
| 45 | + BUF_URL="https://github.com/bufbuild/buf/releases/download/v1.53.0/buf-Linux-x86_64" |
| 46 | + curl -sSL "$BUF_URL" -o /usr/local/bin/buf |
| 47 | + chmod +x /usr/local/bin/buf |
| 48 | +
|
| 49 | + - name: Add buf to PATH |
| 50 | + run: echo "/usr/local/bin" >> $GITHUB_PATH |
| 51 | + |
| 52 | + - name: Check buf version |
| 53 | + run: buf --version |
| 54 | + |
| 55 | + - name: Build using 'uv_buf_build_script.sh' |
| 56 | + run: | |
| 57 | + cd buf-build/ |
| 58 | + chmod +x ./uv_buf_build_script.sh |
| 59 | + ./uv_buf_build_script.sh |
| 60 | +
|
| 61 | + - uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: otdf_python_${{ matrix.python3_version }}_macos |
| 64 | + path: buf-build/buf-build-generated/dist/*.whl |
0 commit comments