mirror of
https://github.com/kristoferssolo/sula-alus.git
synced 2025-10-21 20:00:36 +00:00
fix: CI/CD
This commit is contained in:
parent
33065bdae2
commit
753e9c84cd
43
.github/workflows/publish.yml
vendored
43
.github/workflows/publish.yml
vendored
@ -108,26 +108,47 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Get version and description
|
||||||
|
id: metadata
|
||||||
|
run: |
|
||||||
|
DESCRIPTION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].description')
|
||||||
|
VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')
|
||||||
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "DESCRIPTION=${DESCRIPTION}" >> $GITHUB_OUTPUT
|
||||||
|
- name: Get SHA256 sum
|
||||||
|
id: sha256
|
||||||
|
run: |
|
||||||
|
curl -LO "${{ github.server_url }}/${{ github.repository }}/releases/download/v${{ steps.get_version.outputs.VERSION }}/sula-alus-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
|
echo "SHA256=$(sha256sum sula-alus-x86_64-unknown-linux-gnu.tar.gz | cut -d' ' -f1)" >> $GITHUB_OUTPUT
|
||||||
- name: Generate PKGBUILD
|
- name: Generate PKGBUILD
|
||||||
run: |
|
run: |
|
||||||
cat > PKGBUILD << 'EOF'
|
cat > PKGBUILD << 'EOF'
|
||||||
# Maintainer: Kristofers Solo <dev@kristofers.xyz>
|
# Maintainer: Kristofers Solo <dev@kristofers.xyz>
|
||||||
pkgname=sula-alus-bin
|
pkgname=sula-alus-bin
|
||||||
pkgver=${GITHUB_REF#refs/tags/v}
|
pkgver=${{ steps.metadata.outputs.VERSION }}
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="A CLI tool to reverse strings"
|
pkgdesc="${{ steps.metadata.outputs.DESCRIPTION }}"
|
||||||
arch=('x86_64')
|
arch=("x86_64")
|
||||||
url="https://github.com/$GITHUB_REPOSITORY"
|
url="https://github.com/kristoferssolo/sula-alus"
|
||||||
license=('MIT', 'Apache-2.0')
|
license=("MIT" "Apache-2.0")
|
||||||
provides=('sula-alus')
|
provides=("sula-alus")
|
||||||
conflicts=('sula-alus')
|
conflicts=("sula-alus" "sula-alus-git")
|
||||||
source=("$url/releases/download/v$pkgver/sula-alus-x86_64-unknown-linux-gnu.tar.gz")
|
source=("\${url}/releases/download/v\${pkgver}/sula-alus-x86_64-unknown-linux-gnu.tar.gz")
|
||||||
sha256sums=('SKIP')
|
EOF
|
||||||
|
- name: Update SHA256 and package function
|
||||||
|
run: |
|
||||||
|
echo "sha256sums=(\"${{ steps.sha256.outputs.SHA256 }}\")" >> PKGBUILD
|
||||||
|
echo >> PKGBUILD
|
||||||
|
cat >> PKGBUILD << 'EOF'
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
install -Dm755 sula-alus "$pkgdir/usr/bin/sula-alus"
|
cd "$srcdir/"
|
||||||
|
install -Dm755 sula-alus "${pkgdir}/usr/bin/sula-alus"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
- name: Generate .SRCINFO
|
||||||
|
run: |
|
||||||
|
docker run --rm -v "$PWD":/pkg -w /pkg archlinux:base-devel bash -c 'pacman -Sy --noconfirm base-devel && su nobody -c "makepkg --printsrcinfo" > .SRCINFO'
|
||||||
- name: Publish AUR package
|
- name: Publish AUR package
|
||||||
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
|
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
|
||||||
with:
|
with:
|
||||||
@ -136,5 +157,5 @@ jobs:
|
|||||||
commit_username: ${{ secrets.AUR_USERNAME }}
|
commit_username: ${{ secrets.AUR_USERNAME }}
|
||||||
commit_email: ${{ secrets.AUR_EMAIL }}
|
commit_email: ${{ secrets.AUR_EMAIL }}
|
||||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||||
commit_message: "Update to version ${GITHUB_REF#refs/tags/v}"
|
commit_message: "Update to version ${{ steps.metadata.outputs.VERSION }}"
|
||||||
ssh_keyscan_types: rsa,ecdsa,ed25519
|
ssh_keyscan_types: rsa,ecdsa,ed25519
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -142,7 +142,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sula-alus"
|
name = "sula-alus"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "sula-alus"
|
name = "sula-alus"
|
||||||
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
authors = ["Kristofers Solo <dev@kristofers.xyz>"]
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A CLI tool to encode strings and files using Sula-Alus encoding"
|
description = "A CLI tool to encode strings and files using Sula-Alus encoding"
|
||||||
repository = "https://github.com/kristoferssolo/sula-alus"
|
repository = "https://github.com/kristoferssolo/sula-alus"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user