-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arch packaging
- Loading branch information
Showing
7 changed files
with
136 additions
and
10 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 |
---|---|---|
|
@@ -47,19 +47,77 @@ jobs: | |
with: | ||
command: build | ||
|
||
- name: Create binary | ||
- name: Create Debian package | ||
env: | ||
DESTDIR: '~/authenticator-rs-deb' | ||
run: | | ||
sudo mkdir -p $DESTDIR | ||
mkdir -p $DESTDIR | ||
RELEASE_VERSION=${{ github.event.release.tag_name }} DESTDIR=$DESTDIR make debian-pkg | ||
- name: Upload Release Asset | ||
- name: Upload Debian release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: '${{ github.event.release.upload_url }}' | ||
asset_path: 'authenticator-rs-${{ github.event.release.tag_name }}-x86-64.deb' | ||
asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-x86-64.deb' | ||
asset_path: 'authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb' | ||
asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb' | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Debian release checksum | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: '${{ github.event.release.upload_url }}' | ||
asset_path: 'authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb.md5sum' | ||
asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb.md5sum' | ||
asset_content_type: text/plain | ||
|
||
arch: | ||
runs-on: ubuntu-latest | ||
needs: [ci] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare arch package metadata | ||
run: | | ||
wget https://github.com/grumlimited/authenticator-rs/releases/download/${{ github.event.release.tag_name }}/authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb -O data/arch/authenticator-rs/authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb | ||
MD5_SUM=$(md5sum data/arch/authenticator-rs/authenticator-rs-${{ github.event.release.tag_name }}-x86_64.deb | awk '{print $1}') | ||
awk -v q="'" -v MD5_SUM=$MD5_SUM -i inplace 'BEGINFILE{print "md5sums=(" q MD5_SUM q ")"}{print}' data/arch/authenticator-rs/PKGBUILD | ||
awk -i inplace 'BEGINFILE{print "pkgver=${{ github.event.release.tag_name }}"}{print}' data/arch/authenticator-rs/PKGBUILD | ||
- name: Validate PKGBUILD | ||
id: validate-pkgbuild | ||
uses: grumlimited/[email protected] | ||
with: | ||
target: pkgbuild | ||
pkgbuild: data/arch/authenticator-rs/PKGBUILD | ||
|
||
- name: Create arch package checksum file | ||
run: | | ||
sudo chown -R $USER . | ||
md5sum data/arch/authenticator-rs/*.xz >> data/arch/authenticator-rs/authenticator-rs-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.xz.md5sum | ||
- name: Upload Arch Linux release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: '${{ github.event.release.upload_url }}' | ||
asset_path: 'data/arch/authenticator-rs/authenticator-rs-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.xz' | ||
asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.xz' | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Arch Linux release checksum | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: '${{ github.event.release.upload_url }}' | ||
asset_path: 'data/arch/authenticator-rs/authenticator-rs-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.xz.md5sum' | ||
asset_name: 'authenticator-rs-${{ github.event.release.tag_name }}-1-x86_64.pkg.tar.xz.md5sum' | ||
asset_content_type: text/plain |
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
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
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,30 @@ | ||
# Maintainer: Romain Gallet <[email protected]> | ||
_packager="Romain Gallet <[email protected]>" | ||
pkgname=authenticator-rs | ||
# pkgver=0.0.8 # set in CI | ||
pkgrel=1 | ||
pkgdesc='MFA Authenticator. TOTP-MFA application written in Rust and GTK3.' | ||
arch=('x86_64') | ||
url="https://github.com/grumlimited/$pkgname/releases/download/$pkgver/$pkgname-$pkgver-$arch.deb" | ||
license=('GPLv3') | ||
groups=() | ||
depends=('cairo' 'desktop-file-utils' 'gcc-libs' 'gdk-pixbuf2' 'glib2' 'gtk3' 'hicolor-icon-theme' 'pango' 'sqlite') | ||
makedepends=() | ||
checkdepends=() | ||
optdepends=() | ||
provides=() | ||
replaces=() | ||
backup=() | ||
options=() | ||
install=$pkgname.install | ||
source=($url) | ||
noextract=() | ||
|
||
build() { | ||
rm control.tar.xz | ||
tar xvf data.tar.xz | ||
} | ||
|
||
package() { | ||
cp -fr usr/ ${pkgdir} | ||
} |
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,16 @@ | ||
post_install() { | ||
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor | ||
|
||
chmod +x /usr/bin/authenticator-rs | ||
|
||
update-desktop-database -q | ||
} | ||
|
||
post_upgrade() { | ||
post_install | ||
} | ||
|
||
post_remove() { | ||
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor | ||
update-desktop-database -q | ||
} |
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,8 @@ | ||
Package: authenticator-rs | ||
Section: development | ||
Priority: optional | ||
Architecture: all | ||
Depends: libgtk-3-0, libsqlite3-0, libcairo2, desktop-file-utils, libgdk-pixbuf2.0-0, libglib2.0-0, hicolor-icon-theme | ||
Maintainer: rgallet_at_grumlimited.co.uk | ||
Description: MFA Authenticator | ||
Authenticator-rs is a TOTP-MFA application written in Rust and GTK3. |
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,9 @@ | ||
#!/bin/sh | ||
|
||
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor | ||
|
||
chmod +x /usr/bin/authenticator-rs | ||
|
||
update-desktop-database -q | ||
|
||
exit 0 |