diff --git a/.github/workflows/publish-amd64.yml b/.github/workflows/publish-amd64.yml new file mode 100644 index 0000000..5bc556b --- /dev/null +++ b/.github/workflows/publish-amd64.yml @@ -0,0 +1,35 @@ +name: docker publish amd64 +on: + push: + tags: + - '*' +jobs: + build-amd64: + runs-on: ubuntu-latest + timeout-minutes: 360 + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: setup qemu + uses: docker/setup-qemu-action@v3 + - name: setup buildx + id: buildx + uses: docker/setup-buildx-action@v3 + - name: print available platforms + run: echo ${{ steps.buildx.outputs.platforms }} + - name: set version from tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: print version number + run: echo ${{ env.RELEASE_VERSION }} + - name: login to dockerhub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} + password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} + - name: build & upload + run: | + docker buildx build \ + --push \ + --tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 \ + --platform linux/amd64 \ + --file Dockerfile . \ No newline at end of file diff --git a/.github/workflows/publish-arm64.yml b/.github/workflows/publish-arm64.yml new file mode 100644 index 0000000..e84bee2 --- /dev/null +++ b/.github/workflows/publish-arm64.yml @@ -0,0 +1,37 @@ +name: docker publish arm64 +on: + push: + tags: + - '*' +jobs: + build-arm64: + runs-on: macos-14 + timeout-minutes: 360 + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: setup docker on macOS + uses: douglascamata/setup-docker-macos-action@v1-alpha + - name: setup qemu + uses: docker/setup-qemu-action@v3 + - name: setup buildx + id: buildx + uses: docker/setup-buildx-action@v3 + - name: print available platforms + run: echo ${{ steps.buildx.outputs.platforms }} + - name: set version from tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: print version number + run: echo ${{ env.RELEASE_VERSION }} + - name: login to dockerhub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} + password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} + - name: build & upload + run: | + docker buildx build \ + --push \ + --tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 \ + --platform linux/arm64 \ + --file Dockerfile . \ No newline at end of file diff --git a/.github/workflows/publish-manifest.yml b/.github/workflows/publish-manifest.yml new file mode 100644 index 0000000..61b7ac7 --- /dev/null +++ b/.github/workflows/publish-manifest.yml @@ -0,0 +1,26 @@ +name: docker publish manifest +on: + workflow_run: + workflows: ["docker publish amd64", "docker publish arm64"] + types: + - completed +jobs: + build-manifest: + runs-on: ubuntu-latest + timeout-minutes: 360 + steps: + - name: checkout code + uses: actions/checkout@v4 + - name: set version from tag + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: print version number + run: echo ${{ env.RELEASE_VERSION }} + - name: login to dockerhub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} + password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} + - name: create manifest + run: docker manifest create plattar/python-usd:version-${{ env.RELEASE_VERSION }} plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 + - name: upload manifest + run: docker manifest push plattar/python-usd:version-${{ env.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 7aea590..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: docker publish -on: - push: - tags: - - '*' -jobs: - build-amd64: - runs-on: ubuntu-latest - timeout-minutes: 360 - steps: - - name: checkout code - uses: actions/checkout@v4 - - name: setup qemu - uses: docker/setup-qemu-action@v3 - - name: setup buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: print available platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - name: set version from tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: print version number - run: echo ${{ env.RELEASE_VERSION }} - - name: login to dockerhub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} - password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} - - name: build & upload - run: | - docker buildx build \ - --push \ - --tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 \ - --platform linux/amd64 \ - --file Dockerfile . - build-arm64: - runs-on: macos-14 - timeout-minutes: 360 - steps: - - name: checkout code - uses: actions/checkout@v4 - - name: setup docker on macOS - uses: douglascamata/setup-docker-macos-action@v1-alpha - - name: setup qemu - uses: docker/setup-qemu-action@v3 - - name: setup buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: print available platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - name: set version from tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: print version number - run: echo ${{ env.RELEASE_VERSION }} - - name: login to dockerhub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} - password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} - - name: build & upload - run: | - docker buildx build \ - --push \ - --tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 \ - --platform linux/arm64 \ - --file Dockerfile . - build-manifest: - runs-on: ubuntu-latest - timeout-minutes: 360 - needs: [build-amd64, build-arm64] - steps: - - name: checkout code - uses: actions/checkout@v4 - - name: set version from tag - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: print version number - run: echo ${{ env.RELEASE_VERSION }} - - name: login to dockerhub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} - password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} - - name: create manifest - run: docker manifest create plattar/python-usd:version-${{ env.RELEASE_VERSION }} plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 - - name: upload manifest - run: docker manifest push plattar/python-usd:version-${{ env.RELEASE_VERSION }} \ No newline at end of file