Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: follow .deb naming conventions #969

Merged
merged 15 commits into from
Jan 12, 2023
Next Next commit
ci: follow .deb naming conventions
  • Loading branch information
ClementTsang committed Jan 12, 2023
commit 85b1099fa6c8fdc929ec331c4baeb210dfcfdaf5
26 changes: 18 additions & 8 deletions .github/workflows/build_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ jobs:
uses: ClementTsang/cargo-action@v0.0.3
env:
BTM_GENERATE: true
BTM_BUILD_RELEASE_CALLER: ${{ inputs.caller }}
with:
command: build
args: --release --locked --verbose --features deploy --target ${{ matrix.info.target }}
Expand All @@ -359,28 +360,37 @@ jobs:
run: |
gzip ./manpage/btm.1

- name: Prepare custom version if needed
id: custom-version
if: ${{ inputs.caller == "nightly" }}
run: |
echo "CUSTOM_VERSION_ARG='--deb-version $(./target/${{ matrix.info.target }}/btm -V)'" >> $GITHUB_OUTPUT

- name: Build Debian release (x86-64)
if: matrix.info.cross == false
env:
BTM_GENERATE: true
run: |
cargo install cargo-deb --version 1.41.1 --locked
cargo deb --no-build --target ${{ matrix.info.target }}
cp ./target/${{ matrix.info.target }}/debian/bottom_*.deb ./bottom_${{ matrix.info.target }}.deb
cargo deb --no-build --target ${{ matrix.info.target }} ${{ steps.custom-version.outputs.CUSTOM_VERSION_ARG }}
cp ./target/${{ matrix.info.target }}/debian/bottom_*.deb .

- name: Build Debian release (ARM)
if: matrix.info.cross == true
env:
BTM_GENERATE: true
run: |
docker pull ${{ matrix.info.container }}
docker run -t --rm --mount type=bind,source="$(pwd)",target=/volume ${{ matrix.info.container }} "--variant ${{ matrix.info.dpkg }} --target ${{ matrix.info.target }} --no-build" "/volume"
cp ./target/${{ matrix.info.target }}/debian/bottom-*.deb ./bottom_${{ matrix.info.target }}.deb
docker run -t --rm --mount type=bind,source="$(pwd)",target=/volume ${{ matrix.info.container }} "--variant ${{ matrix.info.dpkg }} --target ${{ matrix.info.target }} --no-build ${{ steps.custom-version.outputs.CUSTOM_VERSION_ARG }}" "/volume"
cp ./target/${{ matrix.info.target }}/debian/bottom-*.deb .

- name: Test Debian release
- name: Verify Debian release
id: verify
run: |
dpkg -I ./bottom_${{ matrix.info.target }}.deb
dpkg -I ./bottom_${{ matrix.info.target }}.deb | grep ${{ matrix.info.dpkg }} && echo "Found correct architecture"
DEB_FILE=$(find bottom_*.deb)
dpkg -I $DEB_FILE
dpkg -I $DEB_FILE | grep ${{ matrix.info.dpkg }} && echo "Found correct architecture"
echo "DEB_FILE=$DEB_FILE" >> $GITHUB_OUTPUT

- name: Delete generated Debian folder
run: |
Expand All @@ -391,7 +401,7 @@ jobs:
shell: bash
run: |
mkdir release
mv bottom_${{ matrix.info.target }}.deb release/
mv ${{ steps.verify.outputs.DEB_FILE }} release/

- name: Save release as artifact
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- [Scoop](#scoop)
- [Chocolatey](#chocolatey)
- [winget](#winget)
- [MSI](#MSI)
- [Windows installer](#windows-installer)
- [Manual installation](#manual-installation)
- [Binaries](#binaries)
- [Auto-completion](#auto-completion)
Expand Down Expand Up @@ -156,11 +156,11 @@ A `.deb` file is provided on each [stable release](https://github.com/ClementTsa
```bash
# x86-64
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.7.1/bottom_x86_64-unknown-linux-gnu.deb
sudo dpkg -i bottom_x86_64-unknown-linux-gnu.deb
sudo dpkg -i bottom_0.7.1_amd64.deb

# ARM64
curl -LO https://github.com/ClementTsang/bottom/releases/download/0.7.1/bottom_aarch64-unknown-linux-gnu.deb
sudo dpkg -i bottom_aarch64-unknown-linux-gnu.deb
sudo dpkg -i bottom_0.7.1_armhf.deb
```

### Snap
Expand Down Expand Up @@ -256,7 +256,7 @@ winget install Clement.bottom

You can uninstall via Control Panel, Options, or `winget --uninstall bottom`.

### MSI
### Windows installer

You can also manually install bottom as a Windows program by going to the [latest release](https://github.com/ClementTsang/bottom/releases/latest)
and installing via the `.msi` file.
Expand Down