Skip to content

fit 3.2.0

fit 3.2.0 #10

Workflow file for this run

#
# This CI workflow builds fit packages for all supported platforms
# and creates a draft GitHub release with packages built in this
# workflow uploaded as assets.
#
#
# GitHub maintains the run number sequence per workflow file name,
# which means that this file needs to be renamed when the version
# is changed, so the run number starts a new sequence.
#
name: fit 3.2.0
on: workflow_dispatch
env:
VERSION: 3.2.0
BUILD_NUMBER: ${{ github.run_number }}
jobs:
#
# Windows build
#
build-windows:
name: Windows build
runs-on: windows-2022
env:
VCVARSALL: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall'
defaults:
run:
shell: cmd
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Restore Nuget packages
run: nuget restore
- name: Set up SHA256 source
run: devops\get-sha256.bat
# only x64 binaries are built on all platforms
- name: Build fit x64
run: |
call "${{ env.VCVARSALL }}" x64
msbuild /nologo /target:Rebuild /property:Configuration=Release;Platform=x64;GH_BUILD_NUMBER=$(BUILD_NUMBER) /nr:false fit.vcxproj
#
# The only way to avoid hard-coded references to Nuget packages
# is to build the application package as a VS project. Use the
# hard-coded Nuget version for now and if SQLite gets updated
# more than expected, a dedicated packaging VS project may be
# introduced into this solution.
#
- name: Create Windows package
run: |
mkdir fit-${{ env.VERSION }}-windows
mkdir fit-${{ env.VERSION }}-windows\sql
copy /y x64\Release\fit.exe fit-${{ env.VERSION }}-windows
copy /y packages\StoneSteps.SQLite.VS2022.Static.3.39.4.1\build\native\bin\sqlite3.exe fit-${{ env.VERSION }}-windows
copy /y README.md fit-${{ env.VERSION }}-windows
copy /y LICENSE. fit-${{ env.VERSION }}-windows
copy /y sql\* fit-${{ env.VERSION }}-windows\sql\
7z a fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.zip fit-${{ env.VERSION }}-windows
- name: Upload Windows package
uses: actions/upload-artifact@v4
with:
name: fit-${{ env.VERSION }}-windows
path: fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.zip
#
# Linux build (all flavors)
#
build-linux:
name: Linux build
strategy:
# no need for x86/x64 in the matrix, as there's no plan to build x86 for this project
matrix:
linux-flavor:
- fedora
- ubuntu
runs-on: ubuntu-22.04
container:
image: ghcr.io/stonestepsinc/fit/${{ matrix.linux-flavor }}:20241006
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up SHA-256
run: |
devops/get-sha256
- name: Build binaries
run: |
make GH_BUILD_NUMBER=${{ env.BUILD_NUMBER }}
- name: Create ${{ matrix.linux-flavor }} package
run: |
mkdir fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
mkdir fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}/sql
cp build/fit fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
cp README.md fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
cp LICENSE fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
cp sql/* fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}/sql
tar czf fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.${{ matrix.linux-flavor }}.x64.tar.gz fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
- name: Upload ${{ matrix.linux-flavor }} package
uses: actions/upload-artifact@v4
with:
name: fit-${{ env.VERSION }}-${{ matrix.linux-flavor }}
path: fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.${{ matrix.linux-flavor }}.x64.tar.gz
#
# Create a draft release
#
create-draft-release:
name: Create a draft release
runs-on: ubuntu-22.04
needs:
- build-windows
- build-linux
outputs:
draft-release-upload-url: ${{ steps.draft-release.outputs.upload_url }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
# without `name` downloads all artifacts
with:
path: .
# collect all artifacts in the same directory identified by `path`
merge-multiple: true
# create an draft release and upload build artifacts
- name: Create a draft release
uses: softprops/action-gh-release@v2
with:
token : ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.VERSION }}
target_commitish: ${{ github.ref_name }}
name: fit ${{ env.VERSION }}
draft: true
files: |
fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.fedora.x64.tar.gz
fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.ubuntu.x64.tar.gz
fit-${{ env.VERSION }}+${{ env.BUILD_NUMBER }}.windows.x64.zip