Workflow file for this run
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: Attach files to release and upload to PPA | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Check tag name | |
run: | | |
tag="${{ github.ref_name }}" | |
echo "$tag" | grep -Pq "^v\d+\.\d+\.\d+$" || (echo "Error: Tag name '$tag' does not correct." && exit 1) | |
- name: 📥 Clone repository | |
uses: actions/checkout@v4.1.2 | |
- name: ⚙️ Install dependencies | |
run: | | |
sudo apt install devscripts dput debhelper -y | |
- name: 🔐 Set up GPG key | |
run: | | |
echo "${{ secrets.PPA_GPG_KEY }}" | gpg --allow-secret-key-import --import --batch --yes | |
- name: 🛠️ Build | |
working-directory: ./dotload | |
run: | | |
export DEBEMAIL="81070564+okineadev@users.noreply.github.com" | |
export DEBFULLNAME="Okinea Dev" | |
tag="${{ github.ref_name }}" | |
release_version=$(echo "$tag" | sed 's/v//g') | |
changes="You can view the changes at this link - https://github.com/okineadev/dotload/releases/tag/$tag" | |
key="-k2783259A7535F745" | |
# gpg_cmd="-p\"gpg --batch --passphrase ${{ secrets.PPA_GPG_KEY_PASSPHRASE }} --pinentry-mode loopback\"" | |
dch --create --distribution jammy --package dotload --newversion $release_version $changes | |
debuild --no-lintian -i -p"gpg --batch --passphrase ${{ secrets.PPA_GPG_KEY_PASSPHRASE }} --pinentry-mode loopback" $key | |
debuild --no-lintian -S -sa -p"gpg --batch --passphrase ${{ secrets.PPA_GPG_KEY_PASSPHRASE }} --pinentry-mode loopback" $key | |
- name: 📦 Upload package to Ubuntu PPA | |
run: | | |
dput ppa:salumin/tools dotload_*_source.changes | |
- name: ⬆️ Upload files to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dotload/bin/dotload | |
dotload_*.deb | |
dotload_*.dsc | |
dotload_*.tar.xz |