Skip to content

Commit

Permalink
autobuild for the aur
Browse files Browse the repository at this point in the history
  • Loading branch information
allancoding committed Oct 25, 2023
1 parent e3192b4 commit c970fe0
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 8 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build!
on:
push:
tags:
- v*
jobs:
build:
name: Build Jar!
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'
- name: Build
run: ./build.sh
- name: Push Jar!
uses: EndBug/add-and-commit@v9
with:
author_name: Allan Niles
author_email: [email protected]
aur:
needs: build
name: Build AUR package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract tag version without v
id: extract_version
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')"
- name: Setup SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
echo -e "Host aur.archlinux.org\n\tIdentityFile ~/.ssh/aur\n\tUser aur" > ~/.ssh/config
- name: Pull changes from AUR
run: |
sed -i "s/pkgver=.*/pkgver=${{ steps.extract_version.outputs.version }}/" PKGBUILD
git clone [email protected]:ascii-battleship.git
cp -u ./README.md kill-net/README.md
cp -u ./LICENSE kill-net/LICENSE
cp -u ./PKGBUILD kill-net/PKGBUILD
cd ascii-battleship
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
sed -i "s/pkgver=.*/pkgver=${{ steps.extract_version.outputs.version }}/" PKGBUILD
cat PKGBUILD
- name: Validate package
uses: hapakaien/archlinux-package-action@v2
with:
path: ascii-battleship
flags: ''
namcap: false
srcinfo: true
updpkgsums: true
- name: Push to AUR
run: |
cd ascii-battleship
cat PKGBUILD
git add .
git commit -m "update to ${{ steps.extract_version.outputs.version }}"
git push
Binary file modified Ascii_Battleship.jar
Binary file not shown.
20 changes: 20 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Maintainer: Allan Niles [email protected]

pkgname=ascii-battleship
pkgver=1.4
pkgrel=1
pkgdesc="An ASCII Battleship game built in Java that can be played in the terminal."
url="https://github.com/allancoding/ascii-battleship"
license=('Apache-2.0')
depends=('java-runtime')
arch=('any')
source=("https://raw.githubusercontent.com/allancoding/ascii-battleship/main/Ascii_Battleship.jar")
sha256sums=('343545c852156d9affe69c0b0963ca49f7011405953362894fa603be91074c4b')
package() {
install -d "${pkgdir}/usr/share/java/${pkgname}"
install -Dm644 "${srcdir}/Ascii_Battleship.jar" "${pkgdir}/usr/share/java/${pkgname}/Ascii_Battleship.jar"
echo "#!/bin/sh" > "${srcdir}/ascii-battleship.sh"
echo "java -jar /usr/share/java/${pkgname}/Ascii_Battleship.jar" >> "${srcdir}/ascii-battleship.sh"
chmod +x "${srcdir}/ascii-battleship.sh"
install -Dm755 "${srcdir}/ascii-battleship.sh" "${pkgdir}/usr/bin/ascii-battleship"
}
6 changes: 0 additions & 6 deletions aur.sh

This file was deleted.

2 changes: 0 additions & 2 deletions setup.sh

This file was deleted.

0 comments on commit c970fe0

Please sign in to comment.