Skip to content

chore: bump to 0.11.0 #18

chore: bump to 0.11.0

chore: bump to 0.11.0 #18

Workflow file for this run

name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write
jobs:
Debian:
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang libbpf-dev libudev-dev pkg-config
- name: Install gcc-multilib
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get install -y gcc-multilib
- name: Fix missing asm/types.h on arm64
if: matrix.os == 'ubuntu-24.04-arm'
run: |
sudo ln -s /usr/include/aarch64-linux-gnu/asm /usr/include/asm
- uses: dtolnay/rust-toolchain@eac0f66a48bc4b70a10b9acd4c4e930f835d95ff # 1.95.0
- name: Build cardwire
run: |
cargo install cargo-deb
cargo build --release --locked
cargo deb --no-build
- name: Find deb filename
id: deb
run: |
DEB_FILE=$(basename target/debian/*.deb)
echo "name=${DEB_FILE}" >> "$GITHUB_OUTPUT"
- name: Upload deb
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.deb.outputs.name }}
path: "target/debian/*.deb"
if-no-files-found: error
ArchLinux:
runs-on: ubuntu-24.04
container:
image: archlinux:latest
env:
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# ssh
- name: Install dependencies
run: |
pacman -Sy openssh git base-devel pacman-contrib --noconfirm
- name: Setup ssh
run: |
mkdir -p /root/.ssh
echo "$AUR_SSH_KEY" > /root/.ssh/aur_key
chmod 600 /root/.ssh/aur_key
ssh-keyscan aur.archlinux.org >> /root/.ssh/known_hosts
cat << EOF > /root/.ssh/config
Host aur.archlinux.org
IdentityFile /root/.ssh/aur_key
User aur
StrictHostKeyChecking no
EOF
- name: Clone AUR repository
run: |
git clone ssh://aur@aur.archlinux.org/cardwire.git aur-repo
- name: Copy new PKGBUILD to aur repo
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
cp packages/arch-linux/cardwire-PKGBUILD aur-repo/PKGBUILD
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" aur-repo/PKGBUILD
- name: Update PKGBUILD and SRCINFO
working-directory: aur-repo
run: |
useradd -m builder
echo 'builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' > /etc/sudoers.d/builder-pacman
chmod 0440 /etc/sudoers.d/builder-pacman
chown -R builder:builder .
su builder -c "updpkgsums"
su builder -c "makepkg --printsrcinfo > .SRCINFO"
- name: Commit and push to AUR
working-directory: aur-repo
run: |
chown -R root:root .
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
VERSION=$(grep '^pkgver=' PKGBUILD | cut -d'=' -f2)
git add PKGBUILD
git add .SRCINFO
git commit -m "chore: update cardwire to v${VERSION}"
git push
- name: Build tar zst
working-directory: aur-repo
run: |
chown -R builder:builder .
su builder -c "makepkg -s --noconfirm"
- name: Find pkg filename
id: pkg
working-directory: aur-repo
run: |
PKG_FILE=$(basename *.pkg.tar.zst)
echo "name=${PKG_FILE}" >> "$GITHUB_OUTPUT"
- name: Upload pkg
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ steps.pkg.outputs.name }}
path: "aur-repo/*.pkg.tar.zst"
if-no-files-found: error
Release:
if: github.event_name == 'push'
needs: [Debian, ArchLinux]
runs-on: ubuntu-24.04
steps:
- name: Download all artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4.2.2
with:
path: artifacts
merge-multiple: true
- name: Upload assets and publish release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
with:
draft: true
files: |
artifacts/*.deb
artifacts/*.pkg.tar.zst
fail_on_unmatched_files: true