diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 692674b..5661242 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -21,6 +21,10 @@ on: required: true default: false +defaults: + run: + shell: bash + env: PYTHON_DEFAULT_VERSION: '3.9' GO_DEFAULT_VERSION: '1.20' @@ -38,7 +42,8 @@ jobs: - { runner: macos-12, os: darwin, arch: amd64 } # macos-13-xlarge instance are Apple silicon instances, # only large and xlarge instances are available as of yet. - - { runner: macos-13-large, os: darwin, arch: arm64 } + - { runner: macos-13, os: darwin, arch: arm64 } + - { runner: windows-2019, os: windows, arch: amd64 } outputs: version: ${{ steps.build.outputs.version }} steps: @@ -61,8 +66,8 @@ jobs: --name builder \ python:${{ env.PYTHON_DEFAULT_VERSION }}-bullseye \ /bin/bash -c "sleep infinity" - - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (darwin) - if: matrix.conf.os == 'darwin' + - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (darwin, windows) + if: matrix.conf.os != 'linux' uses: actions/setup-python@v2 with: python-version: ${{ env.PYTHON_DEFAULT_VERSION }} @@ -77,11 +82,19 @@ jobs: - name: Define command wrapper (darwin) if: matrix.conf.os == 'darwin' run: | - # MacOS wraper just runs commands in python-bindings directory + # MacOS wrapper just runs commands in python-bindings directory echo '#!/bin/bash' > run echo 'pushd python-bindings; "$@"; popd' >> run chmod +x run sudo mv run /usr/local/bin/run + - name: Define command wrapper (windows) + if: matrix.conf.os == 'windows' + run: | + # Windows wrapper just runs commands in python-bindings directory + echo '#!/bin/bash' > run + echo 'pushd python-bindings; "$@"; popd' >> run + chmod +x run + mv run /usr/bin/run - name: Install system dependencies (linux) if: matrix.conf.os == 'linux' run: | @@ -133,6 +146,7 @@ jobs: mv artifacts/py-terraform-provider-b2-linux-arm64/py-terraform-provider-b2 py-terraform-provider-b2-linux-arm64 mv artifacts/py-terraform-provider-b2-darwin-amd64/py-terraform-provider-b2 py-terraform-provider-b2-darwin-amd64 mv artifacts/py-terraform-provider-b2-darwin-arm64/py-terraform-provider-b2 py-terraform-provider-b2-darwin-arm64 + mv artifacts/py-terraform-provider-b2-windows-amd64/py-terraform-provider-b2 py-terraform-provider-b2-windows-amd64 - name: Set release version output id: version run: | diff --git a/.goreleaser.yml b/.goreleaser.yml index 17ac6b6..1454a91 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,9 +12,13 @@ builds: goos: - linux - darwin + - windows goarch: - amd64 - arm64 + ignore: + - goos: windows + goarch: arm64 hooks: pre: - cp python-bindings/dist/py-terraform-provider-b2-{{ .Os }}-{{ .Arch }} python-bindings/dist/py-terraform-provider-b2