aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: 6b85d3093789ea3840714355768493e68abcea05 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: CI
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  build:
    name: Build and Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Web
        run: ./bin/build --web-only
      - name: Dotnet
        run: ./bin/build --dotnet-only
      - name: Upload Static Web Content
        uses: actions/upload-artifact@v2
        with:
          name: web
          path: src/slskd/wwwroot
  publish:
    name: Publish Build Artifacts
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/heads/master'
    strategy:
      matrix:
        runtime: ["win-x64", "linux-x64", "linux-musl-x64", "linux-arm64", "osx-x64"]
    steps:
      - uses: actions/checkout@v2
      - uses: actions/download-artifact@v2
        with:
          name: web
          path: src/slskd/wwwroot
      - name: Publish ${{ matrix.runtime }}
        run: bin/publish --no-prebuild --runtime ${{ matrix.runtime }} --version-suffix $(echo $GITHUB_SHA | cut -c1-7)

      - name: Upload a Build Artifact
        uses: actions/upload-artifact@v2
        with:
          name: ${{ matrix.runtime }}
          path: dist/${{ matrix.runtime }}
  docker:
    name: Build Docker Image
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/heads/master'
    steps:
      - uses: actions/checkout@v2
      - name: Build
        run: docker build -t slskd/slskd:$(echo $GITHUB_SHA | cut -c1-7) .