Skip to content

Add goreleaser

Add goreleaser #35

Workflow file for this run

name: Snap
on:
push:
branches: [ "main", "tests" ]
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v4
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: snap
- name: Test
run: |
sudo snap install --dangerous ${{ needs.build.outputs.snap }}
git clone https://github.com/moodle/moodle
cd moodle
git checkout v4.4.1
powerline-go-moodle | jq -e '.[]["name"] == "moodle"' || exit 1
powerline-go-moodle | jq -e '.[]["content"] == "M4.4.1"' || exit 1
git checkout v4.3.4
powerline-go-moodle | jq -e '.[]["name"] == "moodle"' || exit 1
powerline-go-moodle | jq -e '.[]["content"] == "M4.3.4"' || exit 1
release:
runs-on: ubuntu-latest
needs:
- build
- test
steps:
- uses: actions/download-artifact@v4
with:
name: snap
- uses: snapcore/action-publish@v1
if: "!startsWith(github.ref, 'refs/tags/')"
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: ${{ needs.build.outputs.snap }}
release: edge
- uses: snapcore/action-publish@v1
if: startsWith(github.ref, 'refs/tags/')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: ${{ needs.build.outputs.snap }}
release: stable