Skip to content

Commit 581c2cd

Browse files
committed
Modify
1 parent eeb7e7c commit 581c2cd

File tree

4 files changed

+38
-35
lines changed

4 files changed

+38
-35
lines changed

LICENSE renamed to LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
# The MIT License
22

3-
Copyright (c) [2020] [Gustavo Marin]
3+
Copyright (c) 2020 Hoàng Văn Khải
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
# AUR publish docker action
1+
# Publish AUR packages
22

33
This action can publish an AUR package.
44

5+
## Inputs
56

6-
## Requirements
7-
8-
It depends on an environment variable called `GITHUB_REF` to be present and it should also contain a semantic version
9-
in the format `v0.0.0` to work properly.
10-
11-
This tag should also comply with rules established to publish versions on AUR repository.
12-
13-
You should add to your secrets an SSH private key that match your key uploaded to your AUR account,
14-
so this action can commit and push to it.
7+
### `pkgname`
158

9+
**Required** The AUR package name you want to update.
1610

17-
## Inputs
11+
### `pkgver`
1812

19-
### `package_name`
20-
**Required** The AUR package name you want to update.
13+
**Required** The AUR package version you want to update.
2114

2215
### `commit_username`
16+
2317
**Required** The username to use when creating the new commit.
2418

2519
### `commit_email`
20+
2621
**Required** The email to use when creating the new commit.
2722

2823
### `ssh_private_key`
24+
2925
**Required** Your private key with access to AUR package.
3026

3127

3228
## Example usage
33-
```
29+
30+
```yaml
3431
name: aur-publish
3532

3633
on:
@@ -43,10 +40,14 @@ jobs:
4340
runs-on: ubuntu-latest
4441
steps:
4542
- name: Publish AUR package
46-
uses: guumaster/aur-publish-docker-action@v1
43+
uses: KSXGitHub/github-actions-deploy-aur@master
4744
with:
4845
package_name: my-awesome-package
4946
commit_username: 'Github Action Bot'
5047
commit_email: [email protected]
5148
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
5249
```
50+
51+
## Thanks
52+
53+
This repository is a fork of https://github.com/guumaster/aur-publish-docker-action.git

action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# action.yml
22
name: 'AUR publish docker'
33
description: 'Publish an AUR package'
4-
author: guumaster
4+
author: KSXGitHub
55
branding:
66
color: green
77
icon: upload
88
inputs:
9-
package_name:
9+
pkgname:
1010
description: 'AUR package name'
1111
required: true
12+
pkgver:
13+
description: 'AUR package version'
14+
required: true
1215
commit_username:
1316
description: 'The username to use when creating the new commit.'
1417
required: true
@@ -23,4 +26,4 @@ runs:
2326
using: 'docker'
2427
image: 'Dockerfile'
2528
args:
26-
- ${{ inputs.package_name }} ${{ inputs.commit_username }} ${{ inputs.commit_email }} ${{ inputs.ssh_private_key }}
29+
- ${{ inputs.pkgname }} ${{ inputs.pkgver }} ${{ inputs.commit_username }} ${{ inputs.commit_email }} ${{ inputs.ssh_private_key }}

entrypoint.sh

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,50 @@
22

33
set -o errexit -o pipefail -o nounset
44

5-
PACKAGE_NAME=$INPUT_PACKAGE_NAME
5+
PKGNAME=$INPUT_PKGNAME
6+
PKGVER=${INPUT_PKGVER}
67
COMMIT_USERNAME=$INPUT_COMMIT_USERNAME
78
COMMIT_EMAIL=$INPUT_COMMIT_EMAIL
89
SSH_PRIVATE_KEY=$INPUT_SSH_PRIVATE_KEY
910

10-
NEW_RELEASE=${GITHUB_REF##*/v}
11-
1211
export HOME=/home/builder
1312

14-
echo "---------------- AUR Package version $PACKAGE_NAME/$NEW_RELEASE ----------------"
13+
echo "---------------- AUR Package version $PKGNAME/$PKGVER ----------------"
1514

1615
ssh-keyscan -t ed25519 aur.archlinux.org >> $HOME/.ssh/known_hosts
1716

1817
echo -e "${SSH_PRIVATE_KEY//_/\\n}" > $HOME/.ssh/aur
1918

20-
chmod 600 $HOME/.ssh/aur*
19+
chmod 600 $HOME/.ssh/aur* || exit $?
2120

2221
git config --global user.name "$COMMIT_USERNAME"
2322
git config --global user.email "$COMMIT_EMAIL"
2423

25-
REPO_URL="ssh://[email protected]/${PACKAGE_NAME}.git"
24+
REPO_URL="ssh://[email protected]/${PKGNAME}.git"
2625

2726
echo "---------------- $REPO_URL ----------------"
2827

2928
cd /tmp
30-
git clone "$REPO_URL"
31-
cd "$PACKAGE_NAME"
29+
git clone "$REPO_URL" || exit $?
30+
cd "$PKGNAME" || exit $?
3231

33-
echo "------------- BUILDING PKG $PACKAGE_NAME ----------------"
32+
echo "------------- BUILDING PKG $PKGNAME ----------------"
3433

35-
sed -i "s/pkgver=.*$/pkgver=$NEW_RELEASE/" PKGBUILD
34+
sed -i "s/pkgver=.*$/pkgver=$PKGVER/" PKGBUILD
3635
sed -i "s/sha256sums=.*$/$(makepkg -g 2>/dev/null)/" PKGBUILD
3736

3837
# Test build
39-
makepkg -c
38+
makepkg -c || exit $?
4039

4140
# Update srcinfo
42-
makepkg --printsrcinfo > .SRCINFO
41+
makepkg --printsrcinfo > .SRCINFO || exit $?
4342

4443

4544
echo "------------- BUILD DONE ----------------"
4645

4746
# Update aur
48-
git add PKGBUILD .SRCINFO
49-
git commit --allow-empty -m "Update to $NEW_RELEASE"
50-
git push
47+
git add PKGBUILD .SRCINFO || exit $?
48+
git commit --allow-empty -m "Update to $PKGVER" || exit $?
49+
git push --force || exit $?
5150

5251
echo "------------- PUBLISH DONE ----------------"

0 commit comments

Comments
 (0)