Skip to content

wip

wip #11

Workflow file for this run

name: release
on:
workflow_dispatch:
push:
branches: [workflows]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get the tag name
if: env.VERSION == ''
# run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
run: echo "VERSION=DEBUG" >> $GITHUB_ENV
- name: Print Version
run: echo "$VERSION"
- name: Print Cargo Version
run: cargo -V
- name: Print Package Version
run: |
echo "PKG_VER=$(cargo metadata --no-deps --format-version 1 | jq ".packages[].version" | head -n 1)" >> $GITHUB_ENV
echo $PKG_VER
- name: Check Version
run: |
if ! [ "$PKG_VER" == "VERSION" ]; then
echo "version does not match tag"
# exit 1
fi
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: gh release create $VERSION --draft --verify-tag --title $VERSION
run: gh release create $VERSION --draft --title $VERSION
build:
name: build
env:
APPIMAGETOOL: appimagetool
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install libdrm-dev and mold
run: |
sudo apt update
sudo apt install libdrm-dev mold
- name: Download appimagetool
run: |
curl -o $APPIMAGETOOL -L -O https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x $APPIMAGETOOL
- name: Install cargo-deb
run: mold -run cargo install cargo-deb
- name: Install cargo-generate-rpm
run: mold -run cargo install cargo-generate-rpm
- name: Install cargo-appimage
run: mold -run cargo install cargo-appimage
- name: Build binary
run: mold -run cargo build --release --no-default-features --features="package"
- name: Build Deb Package
run: |
DEBPATH=$(mold -run cargo deb -- --no-default-features --features="package")
gh release upload "$VERSION" "$DEBPATH"
- name: Build RPM Pakcage
run: |
mold -run cargo generate-rpm
gh release upload "$VERSION" ./target/generate-rpm/amdgpu_top-$VERSION-1.x86_64.rpm
- name: Build AppImage
run: |
mold -run cargo appimage &> /dev/null
./$APPIMAGETOOL ./target/amdgpu_top.AppDir
gh release upload "$VERSION" amdgpu_top-x86_64.AppImage