Python custom packages #1028
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
name: Python custom packages | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.repository }}-python-custom | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
package: | |
- pyexiftool | |
- pyinstaller | |
- pyinstaller-hooks-contrib | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Build | |
id: build | |
uses: samarthj/arch-pkgbuild-action@main | |
with: | |
pkgbuild_root: ${{ matrix.package }} | |
aur_username: Sam | |
aur_email: dev@samarthj.com | |
aur_ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
is_python_pkg: true | |
python_pkg_name: ${{ matrix.package }} | |
use_pypi_release_version: true | |
dry_run: false | |
env: | |
GOPATH: /home/builder/.local/share/go | |
GOCACHE: /home/builder/.cache/go | |
- name: Delete tag ${{ matrix.package }} | |
uses: cb80/delrel@latest | |
with: | |
tag: ${{ matrix.package }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release tag ${{ matrix.package }} | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ matrix.package }} | |
name: ${{ steps.build.outputs.ver0 }} | |
body: ${{ steps.build.outputs.ver0 }} | |
allowUpdates: true | |
replacesArtifacts: true | |
artifacts: '*.tar.zst' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Import GPG key | |
id: gpg | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Setup git config | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "Sam" | |
git config --global user.email dev@samarthj.com | |
git config --global user.signkey dev@samarthj.com | |
git config --global commit.gpgsign true | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
- name: Rebase and Push | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git add . | |
git status | |
[ -z "$(git diff FETCH_HEAD --stat)" ] && exit 0 | |
git commit --message "ci(github-actions): :package: updpkg: ${{ steps.build.outputs.ver0 }}" | |
git fetch origin main | |
git pull --rebase origin main | |
git push |