Skip to content

debugging

debugging #13

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go Releaser
on:
push:
branches: [ "goreleaser" ]
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --clean --snapshot --single-target --output dist/powerline-go-moodle
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: testbuild
# A file, directory or wildcard pattern that describes what to upload
path: dist/powerline-go-moodle
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: testbuild
- name: Test
run: |
chmod +x powerline-go-moodle
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: test
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: install snapcraft
run: sudo snap install snapcraft --classic
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
- name: Upload snpacraft log
if: always()
uses: actions/upload-artifact@v4
with:
# Artifact name
name: snapcraft-log
# A file, directory or wildcard pattern that describes what to upload
path: /home/runner/.local/state/snapcraft/log