0.2.21 (#75) #65
This file contains hidden or 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: snap | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - build-for: 'amd64' | |
| - build-for: 'arm64' | |
| - build-for: 'armhf' | |
| - build-for: 'i386' | |
| - build-for: 'riscv64' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| snap-file: ${{ steps.build-snap.outputs.snap }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create snapcraft.yaml | |
| run: | | |
| echo "name: tend" > snapcraft.yaml | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "version: git" >> snapcraft.yaml | |
| else | |
| echo "version: ${{ github.ref_name }}" >> snapcraft.yaml | |
| fi | |
| echo "summary: Command-line tool for managing and running multiple processes" >> snapcraft.yaml | |
| echo "description: Command-line tool for managing and running multiple processes" >> snapcraft.yaml | |
| echo "" >> snapcraft.yaml | |
| echo "confinement: strict" >> snapcraft.yaml | |
| echo "base: core22" >> snapcraft.yaml | |
| echo "" >> snapcraft.yaml | |
| echo "architectures:" >> snapcraft.yaml | |
| echo " - build-on: [amd64]" >> snapcraft.yaml | |
| echo " build-for: [${{ matrix.build-for }}]" >> snapcraft.yaml | |
| echo "" >> snapcraft.yaml | |
| echo "parts:" >> snapcraft.yaml | |
| echo " tend:" >> snapcraft.yaml | |
| echo " plugin: rust" >> snapcraft.yaml | |
| echo " source: ." >> snapcraft.yaml | |
| echo "" >> snapcraft.yaml | |
| echo "apps:" >> snapcraft.yaml | |
| echo " tend:" >> snapcraft.yaml | |
| echo " command: bin/tend" >> snapcraft.yaml | |
| cat snapcraft.yaml | |
| - uses: snapcore/action-build@v1 | |
| id: build-snap | |
| - if: matrix.build-for == 'amd64' | |
| run: | | |
| sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }} | |
| - if: matrix.build-for == 'amd64' | |
| run: | | |
| tend --version | |
| - uses: snapcore/action-publish@v1 | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| with: | |
| snap: ${{ steps.build-snap.outputs.snap }} | |
| release: ${{ startsWith(github.ref, 'refs/tags/') && 'stable' || 'edge' }} |