GHA: More robust OTA updates action #305
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-linux: | |
name: Build on Linux | |
runs-on: ubuntu-latest | |
env: | |
MAKEFLAGS: -j2 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Checkout submodules | |
# submodules are not used by the build, but needed for `make dist`: | |
run: git submodule update --init deps/json deps/pugixml | |
- name: Add wxWidgets 3.2 packages | |
# this is for build testing only, not shipping binaries, so don't bother verifying the key | |
run: | | |
sudo apt-key adv --fetch-keys https://repos.codelite.org/CodeLite.asc | |
sudo apt-add-repository 'deb https://repos.codelite.org/wx3.2/ubuntu/ jammy universe' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install \ | |
gettext \ | |
libexpat1-dev \ | |
libdb++-dev \ | |
libboost-dev \ | |
libboost-system-dev \ | |
libboost-thread-dev \ | |
libboost-iostreams-dev \ | |
liblucene++-dev \ | |
libicu-dev \ | |
libwxgtk3.2unofficial-dev \ | |
libwebkit2gtk-4.0-dev \ | |
libjavascriptcoregtk-4.0-dev \ | |
libnotify-dev \ | |
libwxgtk-webview3.2unofficial-dev \ | |
libgtk-3-dev \ | |
libgtkspell3-3-dev \ | |
libcld2-dev \ | |
libcpprest-dev \ | |
libsecret-1-dev \ | |
libpugixml-dev \ | |
nlohmann-json3-dev | |
- name: Install ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: ${{ github.job }} | |
- name: Add ccache to path | |
run: echo "/usr/lib/ccache" >> $GITHUB_PATH | |
- name: Run bootstrap | |
run: ./bootstrap | |
- name: Run configure | |
run: ./configure | |
- name: Run make distcheck | |
run: make distcheck | |
- name: Upload source tarball artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: source-tarball | |
path: poedit-*.tar.gz | |
build-macos: | |
name: Build on macOS | |
runs-on: macos-14 | |
steps: | |
- name: Setup parallel submodule fetching | |
run: git config --global submodule.fetchJobs 10 | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Deepen git history | |
run: git fetch --deepen=100000 --filter=blob:none origin ${{ github.ref }} | |
- name: Install ccache | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
key: ${{ github.job }} | |
- name: Install external dependencies | |
run: brew bundle --file=macos/Brewfile | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '^15.0.0' | |
- uses: sersoft-gmbh/xcodebuild-action@v3 | |
with: | |
workspace: Poedit.xcworkspace | |
scheme: Poedit | |
parallelize-targets: true | |
action: build | |
build-windows: | |
name: Build on Windows | |
runs-on: windows-latest | |
steps: | |
- name: Setup parallel submodule fetching | |
run: git config --global submodule.fetchJobs 10 | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Deepen git history | |
run: git fetch --deepen=100000 --filter=blob:none origin ${{ github.ref }} | |
- uses: microsoft/setup-msbuild@v2 | |
with: | |
msbuild-architecture: x64 | |
- uses: nuget/setup-nuget@v2 | |
- name: Restore NuGet packages | |
run: nuget restore Poedit.sln | |
- name: Build solution | |
run: msbuild Poedit.sln /p:configuration=Debug | |
publish-release: | |
name: Publish release tarball | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: build-linux | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: source-tarball | |
- uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
prerelease: true | |
artifacts: "*.tar.gz" | |
token: ${{ secrets.GITHUB_TOKEN }} |