Skip to content

fix: field values (#84) #28

fix: field values (#84)

fix: field values (#84) #28

Workflow file for this run

name: Allie Release
on:
push:
tags:
- '*'
env:
MAIN_PYTHON_VERSION: '3.12'
DOCUMENTATION_CNAME: 'laughing-guide-5m1lvq6.pages.github.io'
jobs:
binaries:
name: Create binaries for Windows and Linux
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Build binaries (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
# Build the binaries
go build -tags netgo -o dist/${{ github.event.repository.name }}-${{ github.ref_name }}
- name: Build binaries (Windows)
if: matrix.os == 'windows-latest'
run: |
# Build the binaries
go build -tags netgo -o dist/${{ github.event.repository.name }}-${{ github.ref_name }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-binaries
path: dist/${{ github.event.repository.name }}-*
sign-windows-binary:
name: Sign Windows binary
needs: [binaries]
runs-on:
group: ansys-network
labels: [self-hosted, Windows, signtool]
steps:
- name: Checkout the SignTool
uses: actions/checkout@v4
with:
repository: ansys-internal/signtool-ansys-apps
token: ${{ secrets.SIGNTOOL_ACCESS_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: windows-latest-binaries
path: signtool/installer
- name: List current structure
run: ls -R
- name: Sign application
working-directory: signtool
run: |
$filename = (get-ChildItem installer -recurse | where {$_.name -like "allie-flowkit-*"}).Name
$jobname = $filename -replace ".{4}$"
dotnet signclient.dll sign `
-r [email protected] `
-s '${{ secrets.SIGNTOOL_PWD }}' `
-c AppSettings.json `
-n $jobname `
-i installer/$filename
- uses: actions/upload-artifact@v4
with:
name: windows-latest-binaries-signed
path: signtool/installer/*.exe
release:
name: Create release
needs: [sign-windows-binary, binaries]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Windows binaries
uses: actions/download-artifact@v4
with:
name: windows-latest-binaries-signed
path: dist
- name: Download Linux binaries
uses: actions/download-artifact@v4
with:
name: ubuntu-latest-binaries
path: dist
- name: Release to GitHub
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
generate_release_notes: true
files: |
dist/${{ github.event.repository.name }}-**
docker:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if tag name contains 'dev'
run: echo "is_dev_tag=$(echo ${{ github.ref_name }} | grep -q 'dev' && echo 'true' || echo 'false')" >> $GITHUB_ENV
- name: Decompose tag into components
if: env.is_dev_tag == 'false'
run: |
if [[ ${{ github.ref_name }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Split the tag into its components
IFS='.' read -ra PARTS <<< "${{ github.ref_name }}"
echo "X=${PARTS[0]}" >> $GITHUB_ENV
echo "Y=${PARTS[1]}" >> $GITHUB_ENV
echo "Z=${PARTS[2]}" >> $GITHUB_ENV
else
echo "Invalid tag format. Expected vX.Y.Z but got ${{ github.ref_name }}"
exit 1
fi
- name: Build and push Docker image
if: env.is_dev_tag == 'false'
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}:${{ env.X }} ,
ghcr.io/${{ github.repository }}:${{ env.X }}.${{ env.Y }} ,
ghcr.io/${{ github.repository }}:${{ env.X }}.${{ env.Y }}.${{ env.Z }} ,
ghcr.io/${{ github.repository }}:latest
- name: Build and push Docker image dev
if: env.is_dev_tag == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
doc-build:
name: "Build project documentation"
runs-on: ubuntu-latest
steps:
- name: "Build project documentation"
uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
skip-install: true
requirements-file: doc/requirements.txt
check-links: false
doc-api-reference:
name: "Build API reference documentation"
needs: [doc-build]
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Build GoPages
run: |
go install github.com/johnstarich/go/gopages@latest
gopages -internal -source-link "https://github.com/ansys/allie-flowkit/blob/main/{{.Path}}{{if .Line}}#L{{.Line}}{{end}}"
- name: Download HTML documentation artifacts
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- name: Download and execute Python script
run: |
curl -o doc_api_reference.py https://raw.githubusercontent.com/ansys/allie-sharedtypes/main/pkg/scripts/doc_api_reference.py
python doc_api_reference.py ansys allie-flowkit
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: documentation-html-with-api
path: documentation-html
upload_docs_release:
name: Upload release documentation
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [release, doc-api-reference]
steps:
- name: Deploy the stable documentation
uses: ansys/actions/doc-deploy-stable@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: documentation-html-with-api