-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3192b4
commit c970fe0
Showing
5 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
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
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 not shown.
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
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" | ||
} |