Skip to content

Commit 2f5b473

Browse files
committed
chore: add .tar.gz
1 parent b136387 commit 2f5b473

File tree

3 files changed

+62
-69
lines changed

3 files changed

+62
-69
lines changed

.github/workflows/release.yml

+57-16
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,35 @@ jobs:
1515
include:
1616
- target: x86_64-unknown-linux-gnu
1717
os: ubuntu-latest
18+
container: 'archlinux'
19+
format: pacman
20+
- target: x86_64-unknown-linux-gnu
21+
os: ubuntu-latest
22+
container: ''
23+
format: deb
1824
- target: x86_64-apple-darwin
1925
os: macos-latest
26+
format: dmg
2027
- target: x86_64-pc-windows-msvc
2128
os: windows-latest
29+
format: wix
2230
runs-on: ${{ matrix.os }}
31+
container: ${{ matrix.container }}
2332
steps:
2433
- name: Checkout
2534
uses: actions/checkout@v4
2635

27-
- name: Setup Linux
28-
if: matrix.os == 'ubuntu-latest'
36+
- name: Setup apt Packages
37+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.container == '' }}
2938
uses: awalsh128/cache-apt-pkgs-action@latest
3039
with:
3140
packages: libgtk-3-dev libxdo-dev libayatana-appindicator3-dev libxcb1 libxrandr2 libdbus-1-3
3241
version: 1.0
42+
43+
- name: Setup pacman Packages
44+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.container == 'archlinux' }}
45+
run: |
46+
pacman -Syyu gtk3 xdotool libayatana-appindicator libxcb libxrandr dbus -y
3347
3448
- name: Setup Windows
3549
if: matrix.os == 'windows-latest'
@@ -56,36 +70,45 @@ jobs:
5670
5771
- name: Package binary
5872
run: |
59-
cargo packager --release -v
73+
cargo packager --release --formats ${{ matrix.format }} -v
6074
61-
- name: Upload windows artifacts
75+
- name: Upload .msi to artifacts
6276
uses: actions/upload-artifact@v4
6377
if: matrix.os == 'windows-latest'
6478
with:
65-
name: windows_packages
79+
name: msi
6680
path: |
6781
target/packages/*.msi
68-
target/packages/*.exe
6982
70-
- name: Upload linux artifacts
83+
- name: Upload .deb to artifacts
7184
uses: actions/upload-artifact@v4
72-
if: matrix.os == 'ubuntu-latest'
85+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.container == '' }}
7386
with:
74-
name: linux_packages
87+
name: deb
7588
path: |
7689
target/packages/*.deb
7790
78-
- name: Upload macos artifacts
91+
- name: Upload .tar.gz to artifacts
92+
uses: actions/upload-artifact@v4
93+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.container == 'archlinux' }}
94+
with:
95+
name: tar
96+
path: |
97+
target/packages/*.tar.gz
98+
target/packages/PKGBUILD
99+
100+
- name: Upload .dmg to artifacts
79101
uses: actions/upload-artifact@v4
80102
if: matrix.os == 'macos-latest'
81103
with:
82-
name: macos_packages
104+
name: dmg
83105
path: |
84106
target/packages/*.dmg
85107
86-
upload-assets:
108+
after-build-job:
87109
needs: build-assets
88110
runs-on: 'ubuntu-latest'
111+
container: 'archlinux'
89112
steps:
90113
- name: Checkout
91114
uses: actions/checkout@v4
@@ -107,8 +130,26 @@ jobs:
107130
body: |
108131
${{ steps.changelog.outputs.changes }}
109132
files: |
110-
windows_packages/*
111-
linux_packages/*
112-
macos_packages/*
133+
msi/*
134+
deb/*
135+
tar/*.tar.gz
136+
dmg/*
113137
draft: false
114-
prerelease: false
138+
prerelease: false
139+
140+
- name: Update PKGBUILD and .SRCINFO
141+
run: |
142+
mkdir -p ~/.ssh
143+
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/aur
144+
chmod 600 ~/.ssh/aur
145+
echo -e "Host aur.archlinux.org\n IdentityFile ~/.ssh/aur\n User aur\n StrictHostKeyChecking=no" > ~/.ssh/config
146+
git config --global user.name "${{ secrets.AUR_USERNAME }}"
147+
git config --global user.email "${{ secrets.AUR_EMAIL }}"
148+
git clone ssh://[email protected]/capter.git
149+
cp -rf tar/PKGBUILD capter/PKGBUILD
150+
cd capter
151+
rm .SRCINFO
152+
makepkg --nodeps --nobuild --printsrcinfo > .SRCINFO
153+
git add PKGBUILD .SRCINFO
154+
git commit -m "Update: ${{ github.ref_name }}" || echo "No changes !!"
155+
git push --force

.github/workflows/update_aur.yml

-51
This file was deleted.

Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "capter"
3-
version = "2.2.2"
3+
version = "2.2.3"
44
description = "A simple cross-platform screenshot tool"
55
edition = "2021"
66
authors = ["decipher3114 <[email protected]>"]
@@ -40,7 +40,6 @@ authors = ["decipher3114 <[email protected]>"]
4040
publisher = "decipher3114"
4141
category = "Utility"
4242
copyright = "Copyright © 2024"
43-
formats = ["wix", "deb", "dmg"]
4443
before-packaging-command = "cargo build --release"
4544
icons = ["assets/resources/windows/icon.ico", "assets/resources/macos/icon.icns", "assets/resources/linux/hicolor/*/apps/capter.png"]
4645
out-dir = "target/packages"
@@ -60,3 +59,7 @@ minimum-system-version = "10.13"
6059

6160
[package.metadata.packager.deb]
6261
depends = ["libgtk-3-dev", "libxdo-dev", "libayatana-appindicator3-dev", "libxcb1", "libxrandr2", "libdbus-1-3"]
62+
63+
[package.metadata.packager.pacman]
64+
source = ["${pkgname}-${pkgver}.tar.gz::https://github.com/decipher3114/Capter/releases/latest/download/Capter_${pkgver}_x86_64.tar.gz"]
65+
depends = ["gtk3", "xdotool", "libayatana-appindicator", "libxcb", "libxrandr", "dbus"]

0 commit comments

Comments
 (0)