|
77 | 77 | run: |
|
78 | 78 | sed -i 's/"target": "deb"/"target": "${{ matrix.pkg_to_build }}"/g' package.json && yarn build-release-publish
|
79 | 79 |
|
| 80 | + - name: Backup AppImage latest-linux.yml file |
| 81 | + # only run this on "push" to "master" |
| 82 | + # Note: only AppImage can auto update via electron-builder on linux.continue-on-error. |
| 83 | + # Note: We need to backup the latest-linux appImage file as other builds are overwriting it when they finish |
| 84 | + # after the AppImage build |
| 85 | + if: ${{ env.SHOULD_PUBLISH == 'true' && matrix.pkg_to_build == 'AppImage' }} |
| 86 | + shell: bash |
| 87 | + run: | |
| 88 | + mv dist/latest-linux.yml dist/latest-linux-${{ matrix.pkg_to_build }}.yml |
| 89 | +
|
| 90 | + - name: Upload release metadata |
| 91 | + # only run this on "push" to "master" |
| 92 | + # Check the details of why we need this above (and why only for AppImage) |
| 93 | + if: ${{ env.SHOULD_PUBLISH == 'true' && matrix.pkg_to_build == 'AppImage' }} |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: latest-linux-${{ matrix.pkg_to_build }}.yml |
| 97 | + path: dist/latest-linux-${{ matrix.pkg_to_build }}.yml |
| 98 | + |
| 99 | + post_build_linux: |
| 100 | + needs: [build_linux] |
| 101 | + runs-on: ubuntu-22.04 |
| 102 | + env: |
| 103 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 104 | + steps: |
| 105 | + - name: Checkout git repo |
| 106 | + # only run this on "push" to "master" |
| 107 | + if: ${{ env.SHOULD_PUBLISH == 'true' }} |
| 108 | + uses: actions/checkout@v4 |
| 109 | + # We only need the package.json file in this run (to extract the version being built) |
| 110 | + with: |
| 111 | + sparse-checkout: | |
| 112 | + package.json |
| 113 | + sparse-checkout-cone-mode: false |
| 114 | + |
| 115 | + - name: Get version tag from package.json |
| 116 | + id: get_version |
| 117 | + # only run this on "push" to "master" |
| 118 | + if: ${{ env.SHOULD_PUBLISH == 'true' }} |
| 119 | + run: | |
| 120 | + version=$(node -p "require('./package.json').version") |
| 121 | + echo "VERSION_TAG=$version" >> "$GITHUB_OUTPUT" |
| 122 | +
|
| 123 | + - name: Download release metadata |
| 124 | + # only run this on "push" to "master" |
| 125 | + if: ${{ env.SHOULD_PUBLISH == 'true' }} |
| 126 | + uses: actions/download-artifact@v4 |
| 127 | + with: |
| 128 | + name: latest-linux-AppImage.yml |
| 129 | + path: dist |
| 130 | + |
| 131 | + - name: Rename |
| 132 | + # only run this on "push" to "master" |
| 133 | + if: ${{ env.SHOULD_PUBLISH == 'true' }} |
| 134 | + run: | |
| 135 | + mv dist/latest-linux-AppImage.yml dist/latest-linux.yml |
| 136 | +
|
| 137 | + - name: Upload changes to draft release |
| 138 | + # only run this on "push" to "master" |
| 139 | + if: ${{ env.SHOULD_PUBLISH == 'true' }} |
| 140 | + uses: ncipollo/release-action@v1 |
| 141 | + with: |
| 142 | + tag: v${{ steps.get_version.outputs.VERSION_TAG }} |
| 143 | + draft: true |
| 144 | + name: 'Draft' |
| 145 | + artifacts: 'dist/latest-linux.yml' |
| 146 | + allowUpdates: true |
| 147 | + omitNameDuringUpdate: true |
| 148 | + replacesArtifacts: true |
| 149 | + updateOnlyUnreleased: true |
| 150 | + |
80 | 151 | build_windows:
|
81 | 152 | runs-on: windows-2022
|
82 | 153 | env:
|
|
0 commit comments