Merge pull request #7 from JerryMouseZ/master #46
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 query-pdb server | |
on: | |
push: | |
branches: [ master ] | |
tags: [ 'v*' ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: write | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build-on-linux: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target query_pdb_server | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: query-pdb-server-${{matrix.os}} | |
path: ${{github.workspace}}/build/server/query_pdb_server | |
- name: Make Tarball | |
if: startsWith(github.ref, 'refs/tags/') | |
run: tar -czvf query-pdb-server-${{matrix.os}}.tar.gz -C ${{github.workspace}}/build/server query_pdb_server | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: query-pdb-server-${{matrix.os}}.tar.gz | |
build-on-windows: | |
strategy: | |
matrix: | |
arch: | |
- x86 | |
- amd64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Configure build environment | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "Ninja" | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target query_pdb_server | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: query-pdb-server-windows-${{matrix.arch}} | |
path: | | |
${{github.workspace}}/build/server/query_pdb_server.exe | |
${{github.workspace}}/build/server/*.dll | |
- name: Make Zip | |
if: startsWith(github.ref, 'refs/tags/') | |
run: 7z a query-pdb-server-windows-${{matrix.arch}}.zip ${{github.workspace}}/build/server/query_pdb_server.exe ${{github.workspace}}/build/server/*.dll | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: query-pdb-server-windows-${{matrix.arch}}.zip | |
build-docker: | |
strategy: | |
matrix: | |
pdb-source: | |
- name: microsoft | |
url: https://msdl.microsoft.com/download/symbols/ | |
- name: mirror | |
url: http://msdl.szdyg.cn/download/symbols/ | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add PDB Source to supervisord.conf | |
run: | | |
sed -i "s|\(command=.*\)|\1 --server=${{matrix.pdb-source.url}} --path=/save|" supervisord.conf | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker and Push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: | | |
${{secrets.DOCKERHUB_USERNAME}}/query-pdb-server:${{matrix.pdb-source.name}}-latest |