-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated Distribution Release (#33)
* add artifact & distribution * add windows binary release * bump msvc version * bump msvc dev shell version * remove header include * static build * don't link statically with clang-san * make soro-server not dependent on outer directories * move osm profiles into server_resources * fix msvc linking * msvc linking * msvc linking * use add_subdirectory for client and server build * update tiles * use libc++ for clang build * cmake formatting * remove unused * don't use from_chars with clang libc++ * disable warnings for tiles library * fix warning * fix libc++ coro header * remove unused * use lld for clang builds * use SORO_SERVER_DIR instead of CURRENT_BINARY_DIR * moved to server * fix cmake * fix windows warnings * fix warnings * update readme * update ci yml * fix clang tidy * add automated docker container generation * clean up cmake * Update linux.yml * Create Dockerfile * remove empty line * remove copy paste remnants * msvc compilation * artifact name as parameter * fix windows ci server resources path * fix profile path * fix path * fix paths in windows ci * fix windows path * update dockerfile * update readme * fix link * fix readme
- Loading branch information
1 parent
2f8df15
commit 1466b51
Showing
25 changed files
with
294 additions
and
566 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ jobs: | |
matrix: | ||
config: | ||
- preset: clang-release | ||
artifact: linux-amd64 | ||
- preset: clang-debug | ||
- preset: gcc-release | ||
- preset: gcc-debug | ||
|
@@ -58,11 +59,85 @@ jobs: | |
- name: Build | ||
run: | | ||
buildcache -z | ||
cmake --build build/${{ matrix.config.preset }} --target soro-server-client | ||
cmake --build build/${{ matrix.config.preset }} --target soro-server | ||
buildcache -s | ||
# ==== WEB TESTS ==== | ||
- name: Run Server | ||
run: | | ||
cd ./build/${{ matrix.config.preset }} | ||
./soro-server -t | ||
./soro-server -t --resource_dir ../../resources | ||
# ==== DISTRIBUTION ==== | ||
- name: Create Distribution | ||
if: matrix.config.artifact | ||
run: | | ||
mkdir -p soro-s | ||
rm -rf build/clang-release/server_resources/infrastructure | ||
rm -rf build/clang-release/server_resources/timetable | ||
mv build/clang-release/soro-server soro-s/ | ||
mv build/clang-release/server_resources soro-s/ | ||
tar cjf soro-s-${{ matrix.config.artifact }}.tar.bz2 soro-s | ||
- name: Upload Distribution | ||
if: matrix.config.artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: soro-s-${{ matrix.config.artifact }} | ||
path: soro-s-${{ matrix.config.artifact }}.tar.bz2 | ||
|
||
# ==== RELEASE ==== | ||
- name: Upload Release | ||
if: github.event.action == 'published' && matrix.config.artifact | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./soro-s-${{ matrix.config.artifact }}.tar.bz2 | ||
asset_name: soro-s-${{ matrix.config.artifact }}.tar.bz2 | ||
asset_content_type: application/x-tar | ||
|
||
docker: | ||
runs-on: ubuntu-20.04 | ||
needs: linux | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
|
||
- name: Docker setup-buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
install: true | ||
|
||
- name: Docker Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=edge | ||
- name: Docker build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
context: . | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,14 @@ on: | |
|
||
jobs: | ||
windows-build: | ||
runs-on: windows-2019 | ||
runs-on: windows-2022 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- preset: msvc-release | ||
artifact: windows-amd64 | ||
- preset: msvc-debug | ||
|
||
env: | ||
|
@@ -42,10 +43,49 @@ jobs: | |
$devShell = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll | ||
$installPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath | ||
Import-Module $devShell | ||
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64 -vcvars_ver=14.29" | ||
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64 -vcvars_ver=14.34" | ||
cmake --preset=${{ matrix.config.preset }} | ||
cmake --build build\${{ matrix.config.preset }} --target soro-server | ||
cmake --build build\${{ matrix.config.preset }} --target soro-test | ||
# ==== TESTS ==== | ||
- name: Run Tests | ||
run: .\build\${{ matrix.config.preset }}\soro-test.exe | ||
run: .\build\${{ matrix.config.preset }}\soro-test.exe | ||
|
||
# ==== WEB TESTS ==== | ||
- name: Run Server | ||
run: | | ||
.\build\${{ matrix.config.preset }}\soro-server.exe -t --resource_dir .\resources --server_resource_dir .\build\${{ matrix.config.preset }}\server_resources\ | ||
# ==== DISTRIBUTION ==== | ||
- name: Delete unnecessary files | ||
if: matrix.config.artifact | ||
run: | | ||
rm .\build\${{ matrix.config.preset }}\server_resources\infrastructure -r -force | ||
rm .\build\${{ matrix.config.preset }}\server_resources\timetable -r -force | ||
- name: Create Distribution | ||
if: matrix.config.artifact | ||
run: > | ||
7z a soro-s-${{ matrix.config.artifact }}.zip | ||
.\build\${{ matrix.config.preset }}\soro-server.exe | ||
.\build\${{ matrix.config.preset }}\server_resources | ||
- name: Upload Distribution | ||
if: matrix.config.artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: soro-s-${{ matrix.config.artifact }} | ||
path: soro-s-${{ matrix.config.artifact }}.zip | ||
|
||
# ==== RELEASE ==== | ||
- name: Upload Release | ||
if: github.event.action == 'published' && matrix.config.artifact | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./soro-s-${{ matrix.config.artifact }}.zip | ||
asset_name: soro-s-${{ matrix.config.artifact }}.zip | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
[tiles] | ||
[email protected]:motis-project/tiles.git | ||
branch=master | ||
commit=84b3686006d748b2c48c5ef05763af21b0f8403f | ||
commit=653637bd3fb595eaaca71d9a153ddfcc59930a8b | ||
[rapidjson] | ||
[email protected]:motis-project/rapidjson.git | ||
branch=master | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM alpine:3.14 | ||
ARG TARGETARCH | ||
ADD soro-s-linux-$TARGETARCH/soro-s-linux-$TARGETARCH.tar.bz2 / | ||
RUN addgroup -S soro-s && adduser -S soro-s -G soro-s && \ | ||
chown -R soro-s:soro-s /soro-s/ | ||
|
||
EXPOSE 8080 | ||
VOLUME ["/resources"] | ||
WORKDIR /soro-s | ||
USER soro-s | ||
CMD ["/soro-s/soro-server", "--resource_dir", "/resources"] |
Oops, something went wrong.