diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml new file mode 100644 index 0000000000..8382d11964 --- /dev/null +++ b/.github/workflows/snap.yml @@ -0,0 +1,22 @@ +name: Snap +on: + workflow_dispatch: + push: + branches: + - master + tags: + - "lychee-v*" + +jobs: + build: + if: startsWith(github.ref, 'refs/tags/lychee-v') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: snapcore/action-build@v1 + - uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} + with: + snap: ${{ steps.build.outputs.snap }} + release: ${{ startsWith(github.ref, 'refs/tags/lychee-v') && 'stable' || 'edge'}} diff --git a/.gitignore b/.gitignore index 62e9da5e86..e546bd2d9b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ Thumbs.db /target/ debug/ +# Generated by snapcraft +*.snap + # NOTE: Cargo.lock should be committed for workspaces with both binaries and libraries # Cargo.lock diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 0000000000..81a7996bd2 --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,30 @@ +name: lychee +summary: Fast, async, stream-based link checker written in Rust +description: | + Finds broken hyperlinks and mail addresses, supports Markdown, HTML + and more, simple and lightweight + +website: https://lychee.cli.rs/ +issues: https://github.com/lycheeverse/lychee/issues +source-code: https://github.com/lycheeverse/lychee +license: Apache-2.0 OR MIT + +adopt-info: lychee # set version automatically from git tag + +grade: stable +confinement: strict +base: core24 + +parts: + lychee: + plugin: rust + source: . + build-packages: + - libssl-dev + override-pull: | + craftctl default + craftctl set version=$(git describe --tags --abbrev=10) + +apps: + lychee: + command: lychee