Skip to content

Commit

Permalink
Added automatic AUR publishing GitHub action.
Browse files Browse the repository at this point in the history
* Bumped version to 0.1.2.
  • Loading branch information
AndreasBackx committed May 29, 2021
1 parent 77d9d63 commit 1296ade
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/aur.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Arch User Repository (AUR)

on:
push:
tags:
- "*"

jobs:
aur:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: SHA256 Archive
id: checksum
run: |
export TAG=${GITHUB_REF#refs/tags/}
export CHECKSUM=$(curl -Ls https://codeload.github.com/AndreasBackx/waycorner/tar.gz/${TAG} | sha256sum | awk '{print $1}')
echo "::set-output name=checksum::${CHECKSUM}"
- name: AUR Version Bump
run: |
export TAG=${GITHUB_REF#refs/tags/}
export CHECKSUM=${{ steps.checksum.outputs.checksum }}
echo "Bumping version to ${TAG}"
echo "Checksum: ${CHECKSUM}"
sudo rm -r */src || true
sudo git clean -dfx
git clone ssh://[email protected]/waycorner.git ../aur
rm ../aur/* || truegit
cp templates/PKGBUILD ../aur/PKGBUILD
cp templates/.SRCINFO ../aur/.SRCINFO
cd ../aur
sed -i "s@{{PKG_VERSION}}@${TAG}@g" PKGBUILD
sed -i "s@{{CHECKSUM}}@${CHECKSUM}@g" PKGBUILD
sed -i "s@{{PKG_VERSION}}@${TAG}@g" .SRCINFO
sed -i "s@{{CHECKSUM}}@${CHECKSUM}@g" .SRCINFO
git config user.name "${{ github.event.head_commit.author.name }}"
git config user.email "${{ github.event.head_commit.author.email }}"
git add -A
git diff-index @ --exit-code --quiet || git commit -m "${TAG} version bump.
https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
git --no-pager log
echo ----------------------------
echo PKGBUILD
echo ----------------------------
cat PKGBUILD
echo
echo ----------------------------
echo .SRCINFO
echo ----------------------------
cat .SRCINFO
echo
git push
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install minimal stable with clippy and rustfmt

- name: Install minimal stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Release build

- name: Build release
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --all-features

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "waycorner"
version = "0.1.1"
version = "0.1.2"
authors = ["Andreas Backx"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use wayland::Wayland;
/// Hot corners for Wayland.
/// Waycorner allows you to create anchors on specified locations of your monitors and execute a command of your choice.
#[derive(Clap)]
#[clap(version = "0.1.0", author = "Andreas Backx")]
#[clap(version = "0.1.2", author = "Andreas Backx")]
#[clap(setting = AppSettings::ColoredHelp)]
struct Opts {
/// Config file path.
Expand Down

0 comments on commit 1296ade

Please sign in to comment.