|
| 1 | +on: |
| 2 | + push: |
| 3 | + paths-ignore: ['media/**', 'docs/**', '**/*.md'] |
| 4 | + branches: |
| 5 | + - master |
| 6 | + pull_request: |
| 7 | + paths-ignore: ['media/**', 'docs/**', '**/*.md'] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + target: |
| 16 | + - os: linux |
| 17 | + cpu: amd64 |
| 18 | + - os: linux |
| 19 | + cpu: arm64 |
| 20 | + - os: macos |
| 21 | + cpu: amd64 |
| 22 | + - os: macos |
| 23 | + cpu: arm64 |
| 24 | + - os: windows |
| 25 | + cpu: amd64 |
| 26 | + include: |
| 27 | + - target: |
| 28 | + os: linux |
| 29 | + builder: ubuntu-22.04 |
| 30 | + shell: bash |
| 31 | + - target: |
| 32 | + os: macos |
| 33 | + builder: macos-11 |
| 34 | + shell: bash |
| 35 | + - target: |
| 36 | + os: windows |
| 37 | + builder: windows-2019 |
| 38 | + shell: bash |
| 39 | + defaults: |
| 40 | + run: |
| 41 | + shell: ${{ matrix.shell }} |
| 42 | + |
| 43 | + name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}' |
| 44 | + runs-on: ${{ matrix.builder }} |
| 45 | + steps: |
| 46 | + - name: Checkout |
| 47 | + uses: actions/checkout@v3 |
| 48 | + |
| 49 | + - uses: jiro4989/[email protected] |
| 50 | + with: |
| 51 | + nimversion: ${{ matrix.nimversion }} |
| 52 | + yes: true |
| 53 | + |
| 54 | + - name: Install nimble |
| 55 | + run: | |
| 56 | + git clone https://github.com/yyoncho/nimble -b nim-as-dep |
| 57 | + cd nimble |
| 58 | + nimble -y build -d:release |
| 59 | +
|
| 60 | + - name: test |
| 61 | + run: | |
| 62 | + ./nimble/nimble install |
| 63 | + - name: Compress the Nim Language Server binaries |
| 64 | + if: matrix.target.os != 'windows' |
| 65 | + run: tar -c -z -v -f nimlangserver-${{ matrix.target.os }}-${{ matrix.target.cpu }}.tar.gz nimlangserver |
| 66 | + |
| 67 | + - name: Compress the Nim Language Server binaries |
| 68 | + if: matrix.target.os == 'windows' |
| 69 | + run: tar -c -z -v -f nimlangserver-${{ matrix.target.os }}-${{ matrix.target.cpu }}.tar.gz nimlangserver.exe |
| 70 | + |
| 71 | + - name: Upload the Nim Language Server Binaries |
| 72 | + uses: actions/upload-artifact@v2 |
| 73 | + with: |
| 74 | + name: nimlangserver-${{ matrix.target.os }}-${{ matrix.target.cpu }}.tar.gz |
| 75 | + path: nimlangserver-${{ matrix.target.os }}-${{ matrix.target.cpu }}.tar.gz |
| 76 | + |
| 77 | + create-github-release: |
| 78 | + name: Create Github Release |
| 79 | + needs: [build] |
| 80 | + runs-on: ubuntu-latest |
| 81 | + permissions: |
| 82 | + contents: write |
| 83 | + steps: |
| 84 | + - name: Download artefacts |
| 85 | + uses: actions/download-artifact@v2 |
| 86 | + |
| 87 | + - uses: ncipollo/release-action@v1 |
| 88 | + with: |
| 89 | + name: Latest Langserver Binaries |
| 90 | + artifacts: "*/*" |
| 91 | + allowUpdates: true |
| 92 | + makeLatest: true |
| 93 | + prerelease: true |
| 94 | + tag: latest |
| 95 | + |
| 96 | + - name: Delete artefacts |
| 97 | + uses: geekyeggo/delete-artifact@v1 |
| 98 | + with: |
| 99 | + failOnError: false |
| 100 | + name: "nimlangserver-*" |
0 commit comments