add windows support #18
Workflow file for this run
This file contains 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: pull_request | |
env: | |
IMAGE: paskalmaksim/aks-node-termination-handler:test-${{github.ref_name}} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
#- run: go run github.com/goreleaser/goreleaser@latest build --clean --skip=validate --snapshot | |
- run: cp Dockerfile ./dist/aks-node-termination-handler_linux_amd64_v1/Dockerfile | |
- run: cp Dockerfile ./dist/aks-node-termination-handler_linux_arm64/Dockerfile | |
- run: cp Dockerfile.windows ./dist/aks-node-termination-handler_windows_amd64_v1/Dockerfile | |
- run: tar -cvf release.tar ./dist Dockerfile Dockerfile.windows | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
retention-days: 1 | |
path: release.tar | |
publish-linux-amd64: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: actions/download-artifact@v4 | |
- run: find . | |
- run: "docker build --pull --push --platform linux/amd64 -t ${{ env.IMAGE }}-linux-amd64 ." | |
working-directory: ./release/dist/aks-node-termination-handler_linux_amd64_v1 | |
# publish-linux-arm64: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# - uses: docker/setup-qemu-action@v2 | |
# - uses: docker/setup-buildx-action@v2 | |
# - uses: actions/download-artifact@v4 | |
# - run: "docker build --pull --push --platform linux/arm64 -t ${{ env.IMAGE }}-linux-arm64 ." | |
# working-directory: ./release/dist/aks-node-termination-handler_linux_arm64 | |
# publish-windows: | |
# runs-on: windows-latest | |
# needs: build | |
# steps: | |
# - uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# - uses: actions/download-artifact@v4 | |
# - run: "docker build --pull --platform windows/amd64 -t ${{ env.IMAGE }}-windows-amd64 ." | |
# working-directory: ./release/dist/aks-node-termination-handler_windows_amd64_v1 | |
# - run: docker push ${{ env.IMAGE }}-windows-amd64 | |
# publish-manifest: | |
# runs-on: ubuntu-latest | |
# needs: [publish-linux-amd64, publish-linux-arm64, publish-windows] | |
# steps: | |
# - uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# - run: docker manifest create ${{ env.IMAGE }} ${{ env.IMAGE }}-linux-amd64 ${{ env.IMAGE }}-linux-arm64 ${{ env.IMAGE }}-windows-amd64 | |
# - run: docker manifest push ${{ env.IMAGE }} |