Skip to content

Commit 699a6dc

Browse files
committed
chore: release v1.2.0
1 parent 107091b commit 699a6dc

6 files changed

Lines changed: 155 additions & 17 deletions

File tree

.github/workflows/aur.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: AUR Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to publish (e.g. v1.1.1)'
11+
required: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
publish:
18+
if: github.server_url == 'https://github.com'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Resolve version
22+
id: version
23+
run: |
24+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
25+
TAG="${{ inputs.tag }}"
26+
else
27+
TAG="${GITHUB_REF_NAME}"
28+
fi
29+
PKGVER="${TAG#v}"
30+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
31+
echo "pkgver=$PKGVER" >> "$GITHUB_OUTPUT"
32+
33+
- name: Wait for tarball & compute sha256
34+
id: sha
35+
run: |
36+
URL="https://github.com/madLinux7/dstimer/archive/${{ steps.version.outputs.tag }}.tar.gz"
37+
for i in 1 2 3 4 5; do
38+
if curl -fsSL "$URL" -o src.tar.gz; then
39+
break
40+
fi
41+
echo "Tarball not ready, retry $i/5..."
42+
sleep 10
43+
done
44+
SHA=$(sha256sum src.tar.gz | awk '{print $1}')
45+
echo "sha256=$SHA" >> "$GITHUB_OUTPUT"
46+
47+
- name: Setup SSH for AUR
48+
run: |
49+
mkdir -p ~/.ssh
50+
chmod 700 ~/.ssh
51+
printf '%s\n' "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
52+
chmod 600 ~/.ssh/aur
53+
ssh-keyscan -t rsa,ecdsa,ed25519 aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null
54+
cat > ~/.ssh/config <<EOF
55+
Host aur.archlinux.org
56+
User aur
57+
IdentityFile ~/.ssh/aur
58+
IdentitiesOnly yes
59+
StrictHostKeyChecking yes
60+
EOF
61+
chmod 600 ~/.ssh/config
62+
63+
- name: Clone AUR repo
64+
run: git -c init.defaultBranch=master clone ssh://aur@aur.archlinux.org/dstimer.git aur-repo
65+
66+
- name: Render PKGBUILD & .SRCINFO
67+
env:
68+
PKGVER: ${{ steps.version.outputs.pkgver }}
69+
SHA256: ${{ steps.sha.outputs.sha256 }}
70+
run: |
71+
cat > aur-repo/PKGBUILD <<EOF
72+
# Maintainer: Linus Grolmes <linus@grolmes.de>
73+
pkgname=dstimer
74+
pkgver=${PKGVER}
75+
pkgrel=1
76+
pkgdesc="The Timer for CLI people"
77+
arch=('x86_64' 'aarch64')
78+
url="https://github.com/madLinux7/dstimer"
79+
license=('MIT')
80+
makedepends=('rust' 'alsa-lib' 'pkgconf')
81+
depends=('alsa-lib')
82+
source=("\$pkgname-\$pkgver.tar.gz::https://github.com/madLinux7/dstimer/archive/v\$pkgver.tar.gz")
83+
sha256sums=('${SHA256}')
84+
85+
build() {
86+
cd "\$pkgname-\$pkgver"
87+
cargo build --release --locked
88+
}
89+
90+
package() {
91+
cd "\$pkgname-\$pkgver"
92+
install -Dm755 target/release/dstimer "\$pkgdir/usr/bin/dstimer"
93+
install -Dm644 LICENSE "\$pkgdir/usr/share/licenses/\$pkgname/LICENSE"
94+
}
95+
EOF
96+
97+
cat > aur-repo/.SRCINFO <<EOF
98+
pkgbase = dstimer
99+
pkgdesc = The Timer for CLI people
100+
pkgver = ${PKGVER}
101+
pkgrel = 1
102+
url = https://github.com/madLinux7/dstimer
103+
arch = x86_64
104+
arch = aarch64
105+
license = MIT
106+
makedepends = rust
107+
makedepends = alsa-lib
108+
makedepends = pkgconf
109+
depends = alsa-lib
110+
source = dstimer-${PKGVER}.tar.gz::https://github.com/madLinux7/dstimer/archive/v${PKGVER}.tar.gz
111+
sha256sums = ${SHA256}
112+
113+
pkgname = dstimer
114+
EOF
115+
116+
- name: Commit & push
117+
working-directory: aur-repo
118+
env:
119+
TAG: ${{ steps.version.outputs.tag }}
120+
run: |
121+
git config user.name "Linus Grolmes"
122+
git config user.email "linus@grolmes.de"
123+
git add PKGBUILD .SRCINFO
124+
if git diff --cached --quiet; then
125+
echo "No changes to publish"
126+
exit 0
127+
fi
128+
git commit -m "[ci] Update to ${TAG}"
129+
git push

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
push:
6-
branches: [main]
75

86
jobs:
97
test:

.github/workflows/release.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,4 @@ jobs:
103103
uses: softprops/action-gh-release@v2
104104
with:
105105
files: artifacts/*
106-
generate_release_notes: true
107-
108-
# publish-winget:
109-
# name: Publish to WinGet
110-
# needs: release
111-
# runs-on: windows-latest
112-
# steps:
113-
# - name: Submit to WinGet
114-
# uses: vedantmgoyal9/winget-releaser@v2
115-
# with:
116-
# identifier: madLinux.dstimer
117-
# installers-regex: 'dstimer\.exe$'
118-
# token: ${{ secrets.WINGET_TOKEN }}
106+
generate_release_notes: true

.github/workflows/winget.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Update WinGet Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_run:
7+
workflows: ["Release"]
8+
types: [completed]
9+
workflow_dispatch:
10+
11+
jobs:
12+
winget:
13+
name: Update winget-pkgs manifest
14+
if: github.server_url == 'https://github.com' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Update Package
18+
uses: michidk/winget-updater@v1
19+
with:
20+
komac-token: ${{ secrets.KOMAC_TOKEN }}
21+
identifier: madLinux.dstimer
22+
repo: madLinux7/dstimer
23+
url: "https://github.com/madLinux7/dstimer/releases/download/v{VERSION}/dstimer.exe"

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dstimer"
3-
version = "1.1.0"
3+
version = "1.2.0"
44
edition = "2021"
55
description = "The Timer for CLI people"
66
license = "MIT"

0 commit comments

Comments
 (0)