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/[email protected] | |
- name: ⚙️ Install dependencies | |
# Temporary disable packages caching feature. | |
# uses: awalsh128/cache-apt-pkgs-action@latest | |
# with: | |
# packages: devscripts dput debhelper | |
# version: 1.0 | |
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 .deb package | |
run: | | |
EMAIL="[email protected]" | |
FULLNAME="Okinea Dev" | |
# GPG key to use | |
key="2783259A7535F745" | |
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" | |
make deb-package \ | |
WORKFLOW="true" \ | |
VERSION="$release_version" \ | |
FULLNAME="$FULLNAME" \ | |
EMAIL="$EMAIL" \ | |
CHANGES="$changes" \ | |
PASSPHRASE="${{ secrets.PPA_GPG_KEY_PASSPHRASE }}" \ | |
KEY="$key" | |
- name: 🛠️ Build Snap package | |
run: | | |
sudo iptables -P FORWARD ACCEPT | |
sudo snap install snapcraft --classic | |
sudo usermod -aG lxd $USER | |
sudo snap run lxd init --auto | |
sudo snap run lxd waitready | |
# Login | |
export SNAPCRAFT_STORE_CREDENTIALS="${{ secrets.SNAPCRAFT_CREDENTIALS }}" | |
tag="${{ github.ref_name }}" | |
release_version=$(echo "$tag" | sed 's/v//g') | |
# Build snap package | |
make snap-package \ | |
WORKFLOW="true" \ | |
VERSION="$release_version" | |
- name: ⬆️ Upload files to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dotload/bin/dotload | |
dotload_*.deb | |
dotload_*.snap | |
dotload_*.dsc | |
dotload_*.tar.xz | |
- name: 📦 Upload package to Ubuntu PPA | |
continue-on-error: true | |
run: | | |
dput ppa:salumin/tools dotload_*_source.changes | |
- name: 📦 Upload package to Snap Store | |
continue-on-error: true | |
run: | | |
# Login | |
export SNAPCRAFT_STORE_CREDENTIALS="${{ secrets.SNAPCRAFT_CREDENTIALS }}" | |
snapcraft upload --release=stable dotload_*_all.snap |