first commit #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| jobs: | |
| packaging-debian: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential devscripts dh-make dh-dkms dkms | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: usb_oc-dkms | |
| - name: Packaging | |
| working-directory: usb_oc-dkms | |
| run: | | |
| LATEST_VERSION=$(grep "^PACKAGE_VERSION" "dkms.conf" | sed 's/.*\?"\([^"]*\)".*/\1/') | |
| ln -s packaging/debian debian | |
| sed -i "s/###LATEST_VERSION###/$LATEST_VERSION/g" debian/control debian/changelog | |
| dpkg-buildpackage --build=binary --post-clean --unsigned-source --unsigned-changes | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debian-package | |
| path: "*.deb" | |
| packaging-archlinux: | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: archlinux:base-devel | |
| steps: | |
| - name: Install Dependencies | |
| run: | | |
| pacman-key --init | |
| pacman -Syu --noconfirm git dkms | |
| useradd -m user | |
| sed -i 's/COMPRESSZST=.*/COMPRESSZST=(zstd -c -T0 --ultra -22 -)/' /etc/makepkg.conf | |
| echo "user ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: usb_oc-dkms | |
| - name: Packaging | |
| working-directory: usb_oc-dkms/packaging/arch | |
| run: | | |
| chown -R user: . | |
| sudo -u user makepkg -s --noconfirm | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: arch-package | |
| path: "usb_oc-dkms/packaging/arch/*.pkg*" | |
| release: | |
| runs-on: ubuntu-24.04 | |
| needs: [packaging-debian, packaging-archlinux] | |
| if: github.ref_type == 'tag' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| *.pkg* | |
| *.deb |