|
| 1 | +name: Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Build |
| 17 | + runs-on: windows-2022 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 20 | + with: |
| 21 | + fetch-depth: 1 |
| 22 | + - name: Build |
| 23 | + run: | |
| 24 | + cmake -E make_directory build/x64 |
| 25 | + cmake -E make_directory build/Win32 |
| 26 | + cd build/x64 |
| 27 | + cmake -A x64 ../../ |
| 28 | + cmake --build . --config RelWithDebInfo |
| 29 | + cd ../../build/Win32 |
| 30 | + cmake -A Win32 ../../ |
| 31 | + cmake --build . --config RelWithDebInfo |
| 32 | + - name: Copy to dist |
| 33 | + run: | |
| 34 | + cmake -E make_directory dist |
| 35 | + cmake -E copy build/x64/RelWithDebInfo/rcedit.exe dist/rcedit-x64.exe |
| 36 | + cmake -E copy build/Win32/RelWithDebInfo/rcedit.exe dist/rcedit-x86.exe |
| 37 | + - name: Print help |
| 38 | + run: | |
| 39 | + dist/rcedit-x86.exe -h |
| 40 | + dist/rcedit-x64.exe -h |
| 41 | + - name: Upload artifacts |
| 42 | + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 |
| 43 | + with: |
| 44 | + name: dist |
| 45 | + path: dist/ |
| 46 | + |
| 47 | + release: |
| 48 | + name: Release |
| 49 | + runs-on: windows-2022 |
| 50 | + needs: build |
| 51 | + if: github.ref == 'refs/heads/master' |
| 52 | + permissions: |
| 53 | + contents: write |
| 54 | + steps: |
| 55 | + - name: Checkout |
| 56 | + id: checkout |
| 57 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 58 | + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 |
| 59 | + with: |
| 60 | + name: dist |
| 61 | + path: dist/ |
| 62 | + - run: npm install -g semantic-release@22.0.6 semantic-release-export-data@v1.0.1 |
| 63 | + - run: npx semantic-release@22.0.6 --dry-run |
| 64 | + id: get-next-version |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + - name: Stamp version |
| 68 | + if: steps.get-next-version.outputs.new-release-published == 'true' |
| 69 | + run: | |
| 70 | + set -eo pipefail |
| 71 | + dist/rcedit-x64.exe dist/rcedit-x86.exe --set-product-version $VERSION --set-file-version $VERSION |
| 72 | + dist/rcedit-x86.exe -h | grep -q Rcedit v$VERSION |
| 73 | + dist/rcedit-x86.exe dist/rcedit-x64.exe --set-product-version $VERSION --set-file-version $VERSION |
| 74 | + dist/rcedit-x64.exe -h | grep -q Rcedit v$VERSION |
| 75 | + env: |
| 76 | + VERSION: ${{ steps.get-next-version.outputs.new-release-version }} |
| 77 | + - name: Run semantic release |
| 78 | + run: npx semantic-release@22.0.6 --dry-run |
| 79 | + if: steps.get-next-version.outputs.new-release-published == 'true' |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments