-
Notifications
You must be signed in to change notification settings - Fork 11
GitHub Workflows for Release #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v2 | ||
|
|
@@ -31,7 +31,7 @@ jobs: | |
|
|
||
|
|
||
| - name: Configure CMake | ||
| run: cmake . -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DBUILD_SHARED_LIBS=ON | ||
| run: cmake . -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DBUILD_SHARED_LIBS=ON | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flag allows the windows build to work as expected by baking the Visual C++ runtime code needed for the Like the previous change, this is done here to keep the two files (this and release.yml) consistent. This has no impact on non-windows builds. |
||
|
|
||
| - name: Build with CMake | ||
| run: cmake --build build --config Release -j 16 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '*-Stable' | ||
| - '*-RC' | ||
| - '*-Beta' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Tag/release name to publish (e.g. 0.5-Stable)' | ||
| required: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| # Resolve the release name once (tag name on push, manual input on dispatch). | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.resolve.outputs.version }} | ||
| steps: | ||
| - name: Resolve version | ||
| id: resolve | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| # Windows / macOS (universal) / Linux native builds. | ||
| desktop: | ||
| needs: setup | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| name: linux-x64 | ||
| - os: windows-latest | ||
| name: windows-x64 | ||
| - os: macos-latest | ||
| name: macos-universal | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v2 | ||
| with: | ||
| cmake-version: '3.25.0' | ||
|
|
||
| - name: Install packages | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libspeechd-dev libx11-dev brltty libbrlapi-dev | ||
|
|
||
| - name: Configure CMake | ||
| run: cmake . -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DBUILD_SHARED_LIBS=ON -DBUILD_SRAL_TEST=OFF | ||
|
|
||
| - name: Build with CMake | ||
| run: cmake --build build --config Release -j 16 | ||
|
|
||
| - name: Install into staging tree | ||
| run: cmake --install build --config Release --prefix dist | ||
|
|
||
| - name: Archive artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: bundle-${{ matrix.name }} | ||
| path: dist | ||
|
|
||
| # Collect platform bundles, zip each, and publish the GitHub Release. | ||
| release: | ||
| needs: [setup, desktop] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download bundles | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: bundle-* | ||
| path: bundles | ||
|
|
||
| - name: Package release assets | ||
| run: | | ||
| mkdir -p assets | ||
| version="${{ needs.setup.outputs.version }}" | ||
| for dir in bundles/bundle-*; do | ||
| platform="${dir#bundles/bundle-}" | ||
| (cd "$dir" && zip -r "$GITHUB_WORKSPACE/assets/SRAL-${version}-${platform}.zip" .) | ||
| done | ||
| ls -l assets | ||
|
|
||
| - name: Publish release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ needs.setup.outputs.version }} | ||
| name: SRAL ${{ needs.setup.outputs.version }} | ||
| files: assets/*.zip | ||
| fail_on_unmatched_files: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ target_sources(${PROJECT_NAME}_obj PRIVATE | |
| target_sources(${PROJECT_NAME}_obj PUBLIC | ||
| FILE_SET HEADERS | ||
| BASE_DIRS "${INCLUDES}" | ||
| FILES "${INCLUDES}/SRAL.h") | ||
| FILES "${INCLUDES}/SRAL.h" "${INCLUDES}/Sral.hpp") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this ensures that we include the c++ headers for consumers |
||
| if(WIN32) | ||
| target_sources(${PROJECT_NAME}_obj PRIVATE | ||
| "SRC/NVDA.h" "SRC/NVDA.cpp" "SRC/SAPI.h" "SRC/SAPI.cpp" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to keep these somewhat consistent, I've updated the checkout command here to be v4 - there's still some warning about the node version in the GitHub Actions, but for now, this seems relatively safe, and keeps the files mostly in line with each other.