Skip to content

Commit

Permalink
Add Windows for CD
Browse files Browse the repository at this point in the history
  • Loading branch information
mlech-reef committed Aug 23, 2024
1 parent b64204f commit 6541ed5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
required: true
default: false

defaults:
run:
shell: bash

env:
PYTHON_DEFAULT_VERSION: '3.9'
GO_DEFAULT_VERSION: '1.20'
Expand All @@ -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:
Expand All @@ -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 }}
Expand All @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6541ed5

Please sign in to comment.