diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-09-23 19:13:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 19:13:13 -0400 |
commit | e20057b97c441db44c1bff048db5c1e9aebc14f0 (patch) | |
tree | b296fdb04586a57288121a6a7bd155e5dd2621e0 /.github/workflows/nightly.yml | |
parent | b853aef7525ad576b8d740b644e843312d8a46fe (diff) |
ci: move winget/msi and deb gen to separate steps (#585)
Moves debian and winget/msi generation to a separate job, so it can run in parallel to the other jobs.
Diffstat (limited to '.github/workflows/nightly.yml')
-rw-r--r-- | .github/workflows/nightly.yml | 152 |
1 files changed, 112 insertions, 40 deletions
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fc25489d..e7ba1617 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -164,8 +164,6 @@ jobs: with: fetch-depth: 1 - - uses: actions/setup-python@v2 - - name: Get release download URL uses: actions/download-artifact@v2 with: @@ -185,17 +183,6 @@ jobs: echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" - - name: Install Net-Framework-Core (Windows x86-64 MSVC) - if: matrix.triple.target == 'x86_64-pc-windows-msvc' - shell: powershell - run: Install-WindowsFeature Net-Framework-Core - - - name: Install wixtoolset (Windows x86-64 MSVC) - if: matrix.triple.target == 'x86_64-pc-windows-msvc' - uses: crazy-max/ghaction-chocolatey@v1.4.0 - with: - args: install -y wixtoolset - - name: Install toolchain uses: actions-rs/toolchain@v1 with: @@ -245,8 +232,6 @@ jobs: tar -czvf bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz btm completion echo "ASSET=bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz" >> $GITHUB_ENV - # TODO: Move this elsewhere; do this all at once, and do not continue if any fails. Store artifacts. Do the same for deployment. - - name: Upload main release if: github.event.inputs.isMock != 'mock' uses: actions/upload-release-asset@v1.0.1 @@ -259,16 +244,78 @@ jobs: asset_name: ${{ env.ASSET }} asset_content_type: application/octet-stream - - name: Build msi file (Windows x86-64 MSVC) - if: matrix.triple.target == 'x86_64-pc-windows-msvc' + - name: Release completion files (Linux x86-64 GNU) + if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock != 'mock' + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.RELEASE_UPLOAD_URL }} + asset_path: completion.tar.gz + asset_name: completion.tar.gz + asset_content_type: application/octet-stream + + build-msi: + name: build-msi + needs: [create-github-release] + runs-on: "windows-2019" + env: + RUST_BACKTRACE: 1 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Get release download URL + uses: actions/download-artifact@v2 + with: + name: artifacts + path: artifacts + + - name: Set release upload URL and release version + shell: bash + run: | + release_upload_url="$(cat ./artifacts/release-upload-url)" + echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV + release_version="$(cat ./artifacts/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + + - name: Validate release environment variables + run: | + echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" + echo "Release version: ${{ env.RELEASE_VERSION }}" + + - name: Install Net-Framework-Core + shell: powershell + run: Install-WindowsFeature Net-Framework-Core + + - name: Install wixtoolset + uses: crazy-max/ghaction-chocolatey@v1.4.0 + with: + args: install -y wixtoolset + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: x86_64-pc-windows-msvc + + - uses: Swatinem/rust-cache@v1 + with: + key: x86_64-pc-windows-msvc-msi + + - name: Build msi file shell: powershell run: | cargo install cargo-wix --version 0.3.1 --locked cargo wix init cargo wix - - name: Upload msi file (Windows x86-64 MSVC) - if: matrix.triple.target == 'x86_64-pc-windows-msvc' && github.event.inputs.isMock != 'mock' + - name: Upload msi file + if: github.event.inputs.isMock != 'mock' uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -278,15 +325,57 @@ jobs: asset_name: bottom_x86_64_installer.msi asset_content_type: application/octet-stream - - name: Build Debian release (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' + build-deb: + name: build-deb + needs: [create-github-release] + runs-on: "ubuntu-18.04" + env: + RUST_BACKTRACE: 1 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Get release download URL + uses: actions/download-artifact@v2 + with: + name: artifacts + path: artifacts + + - name: Set release upload URL and release version + shell: bash + run: | + release_upload_url="$(cat ./artifacts/release-upload-url)" + echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV + release_version="$(cat ./artifacts/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + + - name: Validate release environment variables + run: | + echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" + echo "Release version: ${{ env.RELEASE_VERSION }}" + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: x86_64-unknown-linux-gnu + + - uses: Swatinem/rust-cache@v1 + with: + key: x86_64-unknown-linux-gnu-deb + + - name: Build Debian release run: | cargo install cargo-deb --version 1.29.0 --locked cargo deb cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb - - name: Upload Debian file (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock != 'mock' + - name: Upload Debian file if not mock + if: github.event.inputs.isMock != 'mock' uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -295,20 +384,3 @@ jobs: asset_path: bottom_${{ env.RELEASE_VERSION }}_amd64.deb asset_name: bottom_${{ env.RELEASE_VERSION }}_amd64.deb asset_content_type: application/octet-stream - - - name: Compress completion files (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' - shell: bash - run: | - tar -C ./completion -czvf completion.tar.gz . - - - name: Release completion files (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock != 'mock' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: completion.tar.gz - asset_name: completion.tar.gz - asset_content_type: application/octet-stream |