🐛 Fix AUR Release #4
This file contains 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-plz | |
permissions: | |
pull-requests: write | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-plz: | |
name: Release-plz | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run release-plz | |
uses: MarcoIeni/release-plz-action@v0.5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
- name: Update PKGBUILD | |
run: | | |
version=$(grep '^version =' Cargo.toml | sed 's/.*= "\(.*\)"/\1/') | |
sed "s/pkgver=.*/pkgver=$version/" PKGBUILD.template > PKGBUILD | |
sum=$(curl -sL "https://crates.io/api/v1/crates/image-colorizer/$version/download" | sha256sum | cut -d ' ' -f 1) | |
sed -i "s/sha256sums=('PLACEHOLDER')/sha256sums=('$sum')/" PKGBUILD | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Publish AUR package | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
run: | | |
mkdir -p ~/.ssh | |
echo "$SSH_PRIVATE_KEY" > ~/.ssh/aur | |
chmod 600 ~/.ssh/aur | |
eval $(ssh-agent -s) | |
ssh-add ~/.ssh/aur | |
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts | |
git config --global user.name "Taylor Beeston" | |
git config --global user.email "beeston.taylor@gmail.com" | |
git clone ssh://aur@aur.archlinux.org/image-colorizer.git aur-repo | |
cp PKGBUILD aur-repo/ | |
cd aur-repo | |
git add PKGBUILD | |
git commit -S -m "Update to version $version" | |
git push |