|
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | permissions: |
17 | 17 | actions: read |
18 | | - contents: read |
| 18 | + contents: write |
19 | 19 | security-events: write |
20 | 20 | strategy: |
21 | 21 | fail-fast: false |
@@ -48,20 +48,56 @@ jobs: |
48 | 48 | - name: Run tests |
49 | 49 | run: ctest |
50 | 50 |
|
51 | | - - name: Perform CodeQL Analysis |
52 | | - uses: github/codeql-action/analyze@v1 |
53 | | - |
54 | 51 | - name: Build deb package |
55 | 52 | run: sh packaging/deb/create.sh . |
56 | 53 |
|
| 54 | + - name: Perform CodeQL Analysis |
| 55 | + uses: github/codeql-action/analyze@v1 |
| 56 | + |
57 | 57 | - name: Upload binary |
58 | | - uses: actions/upload-artifact@v2 |
| 58 | + if: ${{ github.event_name == "push" }} |
| 59 | + uses: actions/upload-artifact@v3 |
59 | 60 | with: |
60 | 61 | name: fastfetch |
61 | 62 | path: ./fastfetch |
62 | 63 |
|
63 | 64 | - name: Upload deb package |
64 | | - uses: actions/upload-artifact@v2 |
| 65 | + if: ${{ github.event_name == "push" }} |
| 66 | + uses: actions/upload-artifact@v3 |
65 | 67 | with: |
66 | 68 | name: fastfetch.deb |
67 | 69 | path: ./packaging/deb/fastfetch.deb |
| 70 | + |
| 71 | + deploy: |
| 72 | + name: "Create GitHub release" |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: check |
| 75 | + if: ${{ github.event_name == "push" }} |
| 76 | + steps: |
| 77 | + - name: "Download binary" |
| 78 | + uses: actions/download-artifact@v3 |
| 79 | + with: |
| 80 | + name: fastfetch |
| 81 | + path: ./fastfetch |
| 82 | + |
| 83 | + - name: "Download deb package" |
| 84 | + uses: actions/download-artifact@v3 |
| 85 | + with: |
| 86 | + name: fastfetch.deb |
| 87 | + path: ./fastfetch.deb |
| 88 | + |
| 89 | + - name: "Get latest release version" |
| 90 | + id: get_version |
| 91 | + uses: pozetroninc/github-action-get-latest-release@master |
| 92 | + with: |
| 93 | + repository: ${{ github.repository }} |
| 94 | + |
| 95 | + - name: "Create GitHub release" |
| 96 | + if: steps.get_version.outputs.release != $(./fastfetch --version) |
| 97 | + uses: softprops/action-gh-release@v1 |
| 98 | + with: |
| 99 | + tag_name: ${{ $(./fastfetch --version) }} |
| 100 | + generate_release_notes: true |
| 101 | + files: | |
| 102 | + ./fastfetch |
| 103 | + ./fastfetch.deb |
0 commit comments