|
7 | 7 | - "[0-9]+.[0-9]+.[0-9]+-*" |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build-and-publish: |
| 10 | + build: |
| 11 | + uses: ./.github/workflows/build.yml |
| 12 | + |
| 13 | + publish: |
| 14 | + needs: build |
11 | 15 | runs-on: ubuntu-latest |
12 | 16 |
|
13 | 17 | steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 18 | + - name: Download Build Artifacts |
| 19 | + uses: actions/download-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
| 20 | + with: |
| 21 | + name: Build Artifacts |
| 22 | + path: artifacts/build |
| 23 | + |
| 24 | + - name: Download Documentation Artifacts |
| 25 | + uses: actions/download-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a |
16 | 26 | with: |
17 | | - fetch-depth: 0 |
18 | | - filter: tree:0 |
| 27 | + name: Documentation Artifacts |
| 28 | + path: artifacts/docs |
19 | 29 |
|
20 | 30 | - name: Install Nix |
21 | | - uses: cachix/install-nix-action@ab739621df7a23f52766f9ccc97f38da6b7af14f # v31.10.5 |
| 31 | + uses: cachix/install-nix-action@ab739621df7a23f52766f9ccc97f38da6b7af14f |
22 | 32 |
|
23 | 33 | - name: Setup dev environment |
24 | 34 | shell: &dev-shell 'nix develop -c bash -eo pipefail {0}' |
25 | 35 | run: 'true' |
26 | 36 |
|
27 | | - - name: Restore dependencies |
28 | | - shell: *dev-shell |
29 | | - run: dotnet restore |
30 | | - |
31 | | - - name: Build |
32 | | - shell: *dev-shell |
33 | | - run: dotnet build -c Release --no-restore --warnaserror |
34 | | - |
35 | | - - name: Test |
36 | | - shell: *dev-shell |
37 | | - run: dotnet test -c Release --no-build --verbosity normal |
38 | | - |
39 | | - - name: Pack Packages |
40 | | - shell: *dev-shell |
41 | | - run: | |
42 | | - dotnet pack NetCord -c Release --no-build |
43 | | - dotnet pack NetCord.Services -c Release --no-build |
44 | | - dotnet pack Hosting/NetCord.Hosting -c Release --no-build |
45 | | - dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build |
46 | | - dotnet pack Hosting/NetCord.Hosting.AspNetCore -c Release --no-build |
47 | | -
|
48 | | - - name: Setup docs environment |
49 | | - shell: &docs-shell 'nix develop .#docs -c bash -eo pipefail {0}' |
50 | | - run: 'true' |
51 | | - |
52 | | - - name: Build Documentation |
53 | | - shell: *docs-shell |
54 | | - working-directory: Documentation |
55 | | - run: | |
56 | | - npm install |
57 | | - npm run lint |
58 | | - npm run test |
59 | | - npm run build |
60 | | -
|
61 | 37 | - name: Publish Packages |
62 | 38 | shell: *dev-shell |
63 | 39 | env: |
64 | 40 | KEY: ${{ secrets.NUGET_API_KEY }} |
65 | 41 | run: | |
66 | | - dotnet nuget push NetCord/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
67 | | - dotnet nuget push NetCord.Services/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
68 | | - dotnet nuget push Hosting/NetCord.Hosting/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
69 | | - dotnet nuget push Hosting/NetCord.Hosting.Services/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
70 | | - dotnet nuget push Hosting/NetCord.Hosting.AspNetCore/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 42 | + dotnet nuget push artifacts/build/NetCord/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 43 | + dotnet nuget push artifacts/build/NetCord.Services/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 44 | + dotnet nuget push artifacts/build/Hosting/NetCord.Hosting/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 45 | + dotnet nuget push artifacts/build/Hosting/NetCord.Hosting.Services/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
| 46 | + dotnet nuget push artifacts/build/Hosting/NetCord.Hosting.AspNetCore/bin/Release/*.nupkg -k $KEY -s https://api.nuget.org/v3/index.json --skip-duplicate |
71 | 47 |
|
72 | 48 | - name: Deploy Documentation |
73 | | - uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0 |
| 49 | + uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 |
74 | 50 | with: |
75 | 51 | username: ${{ secrets.SSH_USERNAME }} |
76 | 52 | host: ${{ secrets.SSH_HOST }} |
77 | 53 | port: ${{ secrets.SSH_PORT }} |
78 | 54 | key: ${{ secrets.SSH_KEY }} |
79 | 55 | rm: true |
80 | | - source: Documentation/_site |
| 56 | + source: artifacts/docs |
81 | 57 | strip_components: 2 |
82 | 58 | target: ~/NetCord/html |
83 | | - |
84 | | - - name: Upload Build Artifacts |
85 | | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
86 | | - with: |
87 | | - name: Build Artifacts |
88 | | - path: | |
89 | | - NetCord/bin/Release |
90 | | - NetCord.Services/bin/Release |
91 | | - Hosting/NetCord.Hosting/bin/Release |
92 | | - Hosting/NetCord.Hosting.Services/bin/Release |
93 | | - Hosting/NetCord.Hosting.AspNetCore/bin/Release |
94 | | -
|
95 | | - - name: Upload Documentation Artifacts |
96 | | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
97 | | - with: |
98 | | - name: Documentation Artifacts |
99 | | - path: Documentation/_site |
0 commit comments