|
5 | 5 | types: [published] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - build-release: |
9 | | - runs-on: ${{ matrix.os }} |
10 | | - env: |
11 | | - BUILD_TYPE: Release |
12 | | - strategy: |
13 | | - fail-fast: false |
14 | | - matrix: |
15 | | - # specify a specific compiler to build with each OS separately |
16 | | - include: |
17 | | - - platform_name: linux |
18 | | - os: ubuntu-20.04 |
19 | | - cxx: g++-10 |
20 | | - - platform_name: macos |
21 | | - os: macos-10.15 |
22 | | - cxx: clang++ |
23 | | - # NOTE: CXX seems to be ignored on Windows, but specify it anyway for consistency |
24 | | - - platform_name: windows |
25 | | - os: windows-2019 |
26 | | - cxx: msvc |
27 | | - |
28 | | - steps: |
29 | | - - uses: actions/checkout@v2 |
30 | | - |
31 | | - - name: Configure CMake |
32 | | - env: |
33 | | - CXX: ${{ matrix.cxx }} |
34 | | - # Use a bash shell so we can use the same syntax for environment variable |
35 | | - # access regardless of the host operating system |
36 | | - shell: bash |
37 | | - working-directory: ${{github.workspace}}/build |
38 | | - # Note the current convention is to use the -S and -B options here to specify source |
39 | | - # and build directories, but this is only available with CMake 3.13 and higher. |
40 | | - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 |
41 | | - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX:PATH=$GITHUB_WORKSPACE/artifacts |
42 | | - |
43 | | - - name: Build |
44 | | - working-directory: ${{github.workspace}}/build |
45 | | - shell: bash |
46 | | - # Execute the build. You can specify a specific target with "--target <NAME>" |
47 | | - run: cmake --build . --config $BUILD_TYPE |
48 | | - |
49 | | - - name: Install |
50 | | - working-directory: ${{github.workspace}}/build |
51 | | - shell: bash |
52 | | - # Use CMake to "install" build artifacts (only interested in CMake registered targets) to our custom artifacts directory |
53 | | - run: cmake --install . --config $BUILD_TYPE |
54 | | - |
55 | | - - name: Upload |
56 | | - uses: actions/upload-artifact@v2 |
57 | | - with: |
58 | | - name: unmoving_build_${{ github.run_number }}_${{ matrix.platform_name }} |
59 | | - path: ${{github.workspace}}/artifacts |
60 | | - build-docs: |
| 8 | + build: |
61 | 9 | runs-on: ubuntu-20.04 |
62 | | - # don't deploy docs unless release build succeeds |
63 | | - needs: build-release |
64 | 10 | steps: |
65 | 11 | - uses: actions/checkout@v2 |
66 | 12 | - name: Set Tag Name |
67 | | - shell: bash |
68 | 13 | # trim prefix from ref to get tag name |
69 | 14 | run: echo "TAG_NAME=${GITHUB_REF#'refs/tags/'}" >> $GITHUB_ENV |
| 15 | + - name: Get release |
| 16 | + id: get_release |
| 17 | + uses: bruceadams/[email protected] |
| 18 | + env: |
| 19 | + GITHUB_TOKEN: ${{ github.token }} |
| 20 | + - name: Version-stamp Header file |
| 21 | + env: |
| 22 | + RELEASE_URL: ${{ steps.get_release.outputs.html_url }} |
| 23 | + run: | |
| 24 | + echo "// Unmoving $TAG_NAME downloaded from Github at $RELEASE_URL" > header_stub.hpp |
| 25 | + cat header_stub.hpp unmoving/include/unmoving/PSXFixed.hpp > PSXFixed.hpp |
| 26 | + - name: Upload Header file |
| 27 | + |
| 28 | + env: |
| 29 | + GITHUB_TOKEN: ${{ github.token }} |
| 30 | + with: |
| 31 | + upload_url: ${{ steps.get_release.outputs.upload_url }} |
| 32 | + asset_path: ./PSXFixed.hpp |
| 33 | + asset_name: PSXFixed.hpp |
| 34 | + asset_content_type: text/plain |
70 | 35 | - name: Format Docs Version Name |
71 | | - shell: bash |
72 | 36 | # trim patch version off version number as minor version specifies ABI changes |
73 | 37 | run: echo "DOCS_VERSION=${TAG_NAME%.*}" >> $GITHUB_ENV |
74 | 38 | - name: Build Doxygen Docs |
75 | 39 | uses: mattnotmitt/[email protected] |
76 | 40 | - name: Set up latest docs auto-linking |
77 | | - shell: bash |
78 | | - working-directory: ${{github.workspace}} |
79 | 41 | # make docs folder, move docs there, call script to generate HTML redirect in index |
80 | 42 | run: | |
81 | 43 | mkdir docs |
|
0 commit comments