diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4c06cb..d8e81e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,6 +3,9 @@ name: Build RPM on: - push +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -20,15 +23,27 @@ jobs: dnf install -y dnf-plugins-core rpmdevtools && spectool --get-files --directory=SOURCES --all SPECS/*.spec && dnf builddep -y SPECS/*.spec && - rpmbuild --define '_topdir /workspace' -ba SPECS/*.spec + rpmbuild --define '_topdir /workspace' -ba SPECS/*.spec && + grep -i '^version' SPECS/*.spec | awk '{print \"Driver Ver: \" \$NF}' >> release.log && + rpm -q --qf 'Kernel Ver: %{VERSION}-%{RELEASE}\n' kernel-devel >> release.log " + - name: Set Variables + id: vars + run: | + echo "version=$(grep -i '^kernel' release.log | awk '{print $NF}')" >> $GITHUB_OUTPUT + - name: Check run: | - ls -l BUILD/* + ls -l BUILD + cat release.log - - name: Upload Artifact - uses: actions/upload-artifact@v4 + - name: Create Release + uses: softprops/action-gh-release@v2 with: - name: rpm-package - path: RPMS/ + tag_name: ${{ steps.vars.outputs.version }} + body_path: release.log + files: RPMS/* + run: | + ls -l + ls -l RPMS