Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
release:
types: [published]
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# ssh
- name: Install dependencies
run: |
pacman -Sy openssh git --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: |
cp packages/arch-linux/cardwire-PKGBUILD aur-repo/PKGBUILD
- name: Setup pacman
run: |
pacman -S pacman-contrib --noconfirm
- name: Update PKGBUILD and SRCINFO
working-directory: aur-repo
run: |
useradd -m builder
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 log
- name: Build tar zst
working-directory: aur-repo
run: |
makepkg -s
ls