|
| 1 | +name: 'CI / Linux' |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - development |
| 7 | + - linux |
| 8 | + - 'linux-release-*' |
| 9 | + tags: |
| 10 | + - 'release-*.*.*-linux*' |
| 11 | + - 'release-*.*.*-test*' |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - linux |
| 15 | + - linux-vnext |
| 16 | + - 'linux-release-*' |
| 17 | + |
| 18 | +jobs: |
| 19 | + arm64: |
| 20 | + name: Ubuntu arm64 |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + repository: ${{ inputs.repository || github.repository }} |
| 26 | + ref: ${{ inputs.ref }} |
| 27 | + submodules: recursive |
| 28 | + - name: Package and test application in container |
| 29 | + uses: shiftkey/desktop-ubuntu-arm64-packaging@d5a0346959c7d553eb8dbe2828e7fe2e10147160 |
| 30 | + - name: Upload output artifacts |
| 31 | + uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: ubuntu-arm64-artifacts |
| 34 | + path: | |
| 35 | + dist/*.AppImage |
| 36 | + dist/*.deb |
| 37 | + dist/*.rpm |
| 38 | + dist/*.sha256 |
| 39 | + retention-days: 5 |
| 40 | + if-no-files-found: error |
| 41 | + arm: |
| 42 | + name: Ubuntu arm |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + repository: ${{ inputs.repository || github.repository }} |
| 48 | + ref: ${{ inputs.ref }} |
| 49 | + submodules: recursive |
| 50 | + - name: Package and test application in container |
| 51 | + uses: shiftkey/desktop-ubuntu-arm-packaging@48215eee48762e1c919309b2915b8ceb478e5642 |
| 52 | + - name: Upload output artifacts |
| 53 | + uses: actions/upload-artifact@v4 |
| 54 | + with: |
| 55 | + name: ubuntu-arm-artifacts |
| 56 | + path: | |
| 57 | + dist/*.AppImage |
| 58 | + dist/*.deb |
| 59 | + dist/*.rpm |
| 60 | + dist/*.sha256 |
| 61 | + retention-days: 5 |
| 62 | + if-no-files-found: error |
| 63 | + amd64: |
| 64 | + name: Ubuntu x64 |
| 65 | + runs-on: ubuntu-latest |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + repository: ${{ inputs.repository || github.repository }} |
| 70 | + ref: ${{ inputs.ref }} |
| 71 | + submodules: recursive |
| 72 | + - name: Package and test application in container |
| 73 | + uses: shiftkey/desktop-ubuntu-amd64-packaging@33a71a92b43e54694726382d1e4029a91fe894cc |
| 74 | + - name: Upload output artifacts |
| 75 | + uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: ubuntu-amd64-artifacts |
| 78 | + path: | |
| 79 | + dist/*.AppImage |
| 80 | + dist/*.deb |
| 81 | + dist/*.rpm |
| 82 | + dist/*.sha256 |
| 83 | + retention-days: 5 |
| 84 | + if-no-files-found: error |
| 85 | + |
| 86 | + publish: |
| 87 | + name: Create GitHub release |
| 88 | + needs: [arm64, arm, amd64] |
| 89 | + runs-on: ubuntu-latest |
| 90 | + if: startsWith(github.ref, 'refs/tags/') |
| 91 | + permissions: |
| 92 | + contents: write |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + |
| 96 | + - name: Use Node.js 18.14.0 |
| 97 | + uses: actions/setup-node@v4 |
| 98 | + with: |
| 99 | + node-version: 18.14.0 |
| 100 | + cache: yarn |
| 101 | + |
| 102 | + - name: Download all artifacts |
| 103 | + uses: actions/download-artifact@v4 |
| 104 | + with: |
| 105 | + path: './artifacts' |
| 106 | + |
| 107 | + - name: Display structure of downloaded files |
| 108 | + run: ls -R |
| 109 | + working-directory: './artifacts' |
| 110 | + |
| 111 | + - name: Get tag name without prefix |
| 112 | + run: | |
| 113 | + RELEASE_TAG=${GITHUB_REF/refs\/tags\//} |
| 114 | + echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV |
| 115 | + tagNameWithoutPrefix="${RELEASE_TAG:8}" |
| 116 | + echo "RELEASE_TAG_WITHOUT_PREFIX=${tagNameWithoutPrefix}" >> $GITHUB_ENV |
| 117 | +
|
| 118 | + # TODO: generate release notes |
| 119 | + # - pull in default if version matches X.Y.Z-linux1 |
| 120 | + # - otherwise stub template |
| 121 | + |
| 122 | + - name: Generate release notes |
| 123 | + run: | |
| 124 | + node -v |
| 125 | + yarn |
| 126 | + node -r ts-node/register script/generate-release-notes.ts "${{ github.workspace }}/artifacts" "${{ env.RELEASE_TAG_WITHOUT_PREFIX }}" |
| 127 | + RELEASE_NOTES_FILE=script/release_notes.txt |
| 128 | + if [[ ! -f "$RELEASE_NOTES_FILE" ]]; then |
| 129 | + echo "$RELEASE_NOTES_FILE does not exist. Something might have gone wrong while generating the release notes." |
| 130 | + exit 1 |
| 131 | + fi |
| 132 | + echo "Release notes:" |
| 133 | + echo "---" |
| 134 | + cat ${RELEASE_NOTES_FILE} |
| 135 | + echo "---" |
| 136 | +
|
| 137 | + - name: Create Release |
| 138 | + uses: softprops/action-gh-release@v2 |
| 139 | + with: |
| 140 | + name: GitHub Desktop for Linux ${{ env.RELEASE_TAG_WITHOUT_PREFIX }} |
| 141 | + body_path: script/release_notes.txt |
| 142 | + files: | |
| 143 | + artifacts/**/*.AppImage |
| 144 | + artifacts/**/*.deb |
| 145 | + artifacts/**/*.rpm |
| 146 | + artifacts/**/*.sha256 |
| 147 | + draft: true |
| 148 | + fail_on_unmatched_files: true |
| 149 | + env: |
| 150 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments