Skip to content

Fix cp syntax

Fix cp syntax #12

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Snap build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Install snapcraft to build the snap
- name: Install snapcraft
run: sudo snap install snapcraft --classic
# Builds the snap with verbose info in destructive mode
# The build environment should match the snap base. For example, a core24 snap
# should be built inside an Ubuntu 24.04 environment.
- name: Build snap
run: |
sudo snapcraft --verbose --destructive-mode
sudo cp /root/.local/state/snapcraft/log/snapcraft-*.log ./
sudo rm -rf $HOME/.config/snapcraft
- name: Gather snap package name
run: |
snapArtifactPath=$(find . -type f -name *.snap | tr -d '\n')
echo "Snap package name is: '$snapArtifactPath'"
echo "snapArtifactPath=$snapArtifactPath" >> $GITHUB_ENV
- name: Upload snap package artifact
uses: actions/upload-artifact@v4
with:
name: snap-package
path: ${{ env.snapArtifactPath }}
- name: Upload log artifact
uses: actions/upload-artifact@v4
with:
name: snapcraft-log
path: snapcraft-*.log
# if: ${{ hashFiles('assets/') != '' }}