-
-
Notifications
You must be signed in to change notification settings - Fork 614
feat(packaging): add Arch Linux AUR package with automated publishing workflow #1268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akshajtiwari
wants to merge
6
commits into
AOSSIE-Org:main
Choose a base branch
from
akshajtiwari:arch-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f108e88
fix(tauri): update scope to include thumbnails from hidden folders
akshajtiwari 0c1c9bb
ci(release): add temporary workflow changes to enable fork release fo…
akshajtiwari cf050d7
feat(packaging): add Arch Linux AUR package with automated publishing…
akshajtiwari b338673
revert(ci): revert temporary release workflow changes made for fork t…
akshajtiwari cb60213
fix(tauri): configure asset protocol security scope for thumbnails
akshajtiwari 7d82cfe
Fix curl command typo for SHA calculation
akshajtiwari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,101 @@ | ||
| name: Publish to AUR - pictopy-bin | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 0 * * *' | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| update_version: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| need_update: ${{ steps.check_version.outputs.need_update }} | ||
| latest_version: ${{ steps.check_version.outputs.latest_version }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config --global user.name "${GITHUB_ACTOR}" | ||
| git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
|
|
||
| - name: Check if update is needed | ||
| id: check_version | ||
| run: | | ||
| cd publishing | ||
|
|
||
| LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/AOSSIE-Org/PictoPy/releases/latest \ | ||
| | grep -oP '(?<="tag_name": "v)[^"]+') | ||
| echo "Latest version: $LATEST_VERSION" | ||
|
|
||
| CURRENT_VERSION=$(grep -oP '(?<=pkgver=)[0-9.]+' PKGBUILD) | ||
| echo "Current version: $CURRENT_VERSION" | ||
|
|
||
| if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then | ||
| echo "need_update=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "need_update=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| echo "latest_version=$LATEST_VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Compute sha256 of new deb | ||
| if: steps.check_version.outputs.need_update == 'true' | ||
| id: sha | ||
| run: | | ||
| VERSION=${{ steps.check_version.outputs.latest_version }} | ||
| DEB_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}/PictoPy_${VERSION}_amd64.deb" | ||
| SHA=$(curl -fsSL "$DEB_URL" | sha256sum | cut -d' ' -f1) | ||
| echo "sha=$SHA" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Update PKGBUILD | ||
| if: steps.check_version.outputs.need_update == 'true' | ||
| run: | | ||
| VERSION=${{ steps.check_version.outputs.latest_version }} | ||
| SHA=${{ steps.sha.outputs.sha }} | ||
|
|
||
| cd publishing | ||
| sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD | ||
| sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD | ||
| sed -i "s/sha256sums=.*/sha256sums=('$SHA')/" PKGBUILD | ||
|
|
||
| git add PKGBUILD | ||
| git commit -m "upgpkg: pictopy-bin $VERSION" | ||
| git push | ||
|
|
||
| - name: Upload artifacts for publish job | ||
| if: steps.check_version.outputs.need_update == 'true' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: PKGBUILD | ||
| path: | | ||
| publishing/PKGBUILD | ||
| publishing/pictopy-bin.install | ||
|
|
||
| publish_aur: | ||
| runs-on: ubuntu-latest | ||
| needs: update_version | ||
| if: needs.update_version.outputs.need_update == 'true' | ||
|
|
||
| steps: | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: PKGBUILD | ||
|
|
||
| - name: Publish to AUR | ||
| uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 | ||
| with: | ||
| pkgname: pictopy-bin | ||
| pkgbuild: ./PKGBUILD | ||
| commit_username: ${{ secrets.AUR_USERNAME }} | ||
| commit_email: ${{ secrets.AUR_EMAIL }} | ||
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
| commit_message: v${{ needs.update_version.outputs.latest_version }} | ||
| ssh_keyscan_types: rsa,ecdsa,ed25519 | ||
| updpkgsums: false | ||
| allow_empty_commits: false | ||
This file contains hidden or 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 hidden or 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 hidden or 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,19 @@ | ||
| pkgbase=pictopy | ||
| pkgname=pictopy-bin | ||
| pkgver=1.0.0 | ||
| pkgrel=1 | ||
| pkgdesc="A desktop image gallery with a privacy-first approach. It detects objects and clusters faces." | ||
| arch=('x86_64') | ||
| url="https://github.com/AOSSIE-Org/PictoPy" | ||
| license=('GPL-3.0-only') | ||
| depends=('gtk3' 'python' 'hicolor-icon-theme') | ||
| makedepends=('binutils') | ||
| install=pictopy-bin.install | ||
| source=("${pkgname}-${pkgver}.deb::https://github.com/AOSSIE-Org/PictoPy/releases/download/v${pkgver}/PictoPy_${pkgver}_amd64.deb") | ||
| sha256sums=('SKIP') | ||
|
akshajtiwari marked this conversation as resolved.
|
||
|
|
||
| package() { | ||
| cd "$srcdir" | ||
| ar x "${pkgname}-${pkgver}.deb" | ||
| tar xf data.tar.* -C "$pkgdir" | ||
| } | ||
This file contains hidden or 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,6 @@ | ||
| post_remove() { | ||
| for home_dir in /home/*; do | ||
| rm -rf "${home_dir}/.local/share/picto_py" | ||
| rm -rf "${home_dir}/.cache/picto_py" | ||
| done | ||
| } | ||
|
akshajtiwari marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.