Refactor snapcraft.yaml to use the latest version of the snapcore/sna… #71
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: Linpad application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
attestations: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
run: | | |
pytest test/ | |
- name: Update executable in usr/bin | |
run: | | |
cp linpad.py usr/bin/linpad | |
chmod +x usr/bin/linpad | |
- name: List project files | |
run: | | |
ls -R | |
- name: Package Application | |
run: | | |
mkdir -p output | |
cp -r ./linpad.py ./output/ | |
cp ./lin_logo.webp ./output/ | |
cp -r ./DEBIAN ./output/ | |
cp README.md ./output/ | |
cp LICENSE ./output/ | |
cp -r ./usr ./output/usr | |
- name: Create .deb Package | |
run: | | |
cd output | |
dpkg-deb --build . linpad.deb | |
- name: Upload .deb Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linpad-deb-package | |
path: output/linpad.deb | |
- name: Attest | |
uses: actions/attest-build-provenance@v1 | |
id: attest | |
with: | |
subject-path: '${{ github.workspace }}/output' |