Skip to content

Automate selection of latest SDK versions #1089

Automate selection of latest SDK versions

Automate selection of latest SDK versions #1089

Workflow file for this run

name: Continuous Integration
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
workflow_dispatch:
inputs:
go_sdk_version:
default: ''
type: string
typescript_sdk_version:
default: ''
type: string
java_sdk_version:
default: ''
type: string
python_sdk_version:
default: ''
type: string
dotnet_sdk_version:
default: ''
type: string
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Build cli and harnesses and get the latest SDK versions
build-go:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # windows-latest - like 8x slower. Excluded for now since we're just building.
runs-on: ${{ matrix.os }}
outputs:
go_latest: ${{ steps.latest_version.outputs.go_latest }}
typescript_latest: ${{ steps.latest_version.outputs.typescript_latest }}
java_latest: ${{ steps.latest_version.outputs.java_latest }}
python_latest: ${{ steps.latest_version.outputs.python_latest }}
csharp_latest: ${{ steps.latest_version.outputs.csharp_latest }}
steps:
- name: Print build information
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", os: ${{ matrix.os }}'
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21'
- run: go build -o temporal-features
- name: Get the latest release version
id: latest_version
run: |
latest_version=$(./temporal-features latest-sdk-version --lang go)
go_latest=$(echo "$latest_version" | sed 's/^v//')
if [ "${{ github.event.inputs.go_sdk_version }}" != "" ]; then
go_latest="${{ github.event.inputs.go_sdk_version }}"
echo "User-provided Go SDK version: $go_latest"
else
echo "Latest Go SDK release version: $go_latest"
fi
echo "go_latest=$go_latest" >> $GITHUB_OUTPUT
latest_version=$(./temporal-features latest-sdk-version --lang ts)
typescript_latest=$(echo "$latest_version" | sed 's/^v//')
if [ "${{ github.event.inputs.typescript_sdk_version }}" != "" ]; then
typescript_latest="${{ github.event.inputs.typescript_sdk_version }}"
echo "User-provided typescript SDK version: $typescript_latest"
else
echo "Latest typescript SDK release version: $typescript_latest"
fi
echo "typescript_latest=$typescript_latest" >> $GITHUB_OUTPUT
latest_version=$(./temporal-features latest-sdk-version --lang java)
java_latest=$(echo "$latest_version" | sed 's/^v//')
if [ "${{ github.event.inputs.java_sdk_version }}" != "" ]; then
java_latest="${{ github.event.inputs.java_sdk_version }}"
echo "User-provided java SDK version: $java_latest"
else
echo "Latest java SDK release version: $java_latest"
fi
echo "java_latest=$java_latest" >> $GITHUB_OUTPUT
latest_version=$(./temporal-features latest-sdk-version --lang py)
python_latest=$(echo "$latest_version" | sed 's/^v//')
if [ "${{ github.event.inputs.python_sdk_version }}" != "" ]; then
python_latest="${{ github.event.inputs.python_sdk_version }}"
echo "User-provided python SDK version: $python_latest"
else
echo "Latest python SDK release version: $python_latest"
fi
echo "python_latest=$python_latest" >> $GITHUB_OUTPUT
latest_version=$(./temporal-features latest-sdk-version --lang cs)
csharp_latest=$(echo "$latest_version" | sed 's/^v//')
if [ "${{ github.event.inputs.dotnet_sdk_version }}" != "" ]; then
csharp_latest="${{ github.event.inputs.dotnet_sdk_version }}"
echo "User-provided dotnet SDK version: $csharp_latest"
else
echo "Latest dotnet SDK release version: $csharp_latest"
fi
echo "csharp_latest=$csharp_latest" >> $GITHUB_OUTPUT
build-ts:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # windows-latest - like 8x slower. Excluded for now since we're just building.
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", os: ${{ matrix.os }}'
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: npm ci
- run: npm run build
- run: npm run lint
build-python:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # windows-latest - like 8x slower. Excluded for now since we're just building.
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", os: ${{ matrix.os }}'
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install --upgrade wheel poetry poethepoet
- run: poetry install --no-root
- run: poe lint
build-java:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # windows-latest - like 8x slower. Excluded for now since we're just building.
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", os: ${{ matrix.os }}'
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- run: ./gradlew build
build-dotnet:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] # windows-latest - like 8x slower. Excluded for now since we're just building.
runs-on: ${{ matrix.os }}
steps:
- name: Print build information
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", os: ${{ matrix.os }}'
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- run: dotnet build
- run: dotnet test
feature-tests-ts:
needs: build-go
uses: ./.github/workflows/typescript.yaml
with:
version: ${{ needs.build-go.outputs.typescript_latest }}
version-is-repo-ref: false
features-repo-ref: ${{ github.head_ref }}
features-repo-path: ${{ github.event.pull_request.head.repo.full_name }}
feature-tests-go:
needs: build-go
uses: ./.github/workflows/go.yaml
with:
version: ${{ needs.build-go.outputs.go_latest }}
version-is-repo-ref: false
features-repo-ref: ${{ github.head_ref }}
features-repo-path: ${{ github.event.pull_request.head.repo.full_name }}
feature-tests-python:
needs: build-go
uses: ./.github/workflows/python.yaml
with:
version: ${{ needs.build-go.outputs.python_latest }}
version-is-repo-ref: false
features-repo-ref: ${{ github.head_ref }}
features-repo-path: ${{ github.event.pull_request.head.repo.full_name }}
feature-tests-java:
needs: build-go
uses: ./.github/workflows/java.yaml
with:
version: 'v${{ needs.build-go.outputs.java_latest }}'
version-is-repo-ref: false
features-repo-ref: ${{ github.head_ref }}
features-repo-path: ${{ github.event.pull_request.head.repo.full_name }}
feature-tests-dotnet:
needs: build-go
uses: ./.github/workflows/dotnet.yaml
with:
version: ${{ needs.build-go.outputs.csharp_latest }}
version-is-repo-ref: false
features-repo-ref: ${{ github.head_ref }}
features-repo-path: ${{ github.event.pull_request.head.repo.full_name }}
build-docker-images:
needs: build-go
uses: ./.github/workflows/all-docker-images.yaml
secrets: inherit
# TODO: Find some way to automatically upgrade to "latest"
with:
do-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
go-ver: 'v${{ needs.build-go.outputs.go_latest }}'
ts-ver: 'v${{ needs.build-go.outputs.typescript_latest }}'
java-ver: 'v${{ needs.build-go.outputs.java_latest }}'
py-ver: 'v${{ needs.build-go.outputs.python_latest }}'
cs-ver: 'v${{ needs.build-go.outputs.csharp_latest }}'