aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build-artifacts.yml
blob: 99a1b0fd4dd596ab534c5b4fc8fdd1d2d5eae78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build Artifacts

on:
  workflow_dispatch:
  push:
    branches:
      - main
  pull_request:

permissions:
  contents: write

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: go.mod
          cache: true

      - name: Install Mage
        run: |
          go install github.com/magefile/mage@v1.15.0
          echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

      - name: Build plugin and standalone binaries
        run: mage

      - name: Publish binaries to GitHub Release assets
        if: github.event_name != 'pull_request'
        uses: softprops/action-gh-release@v2
        with:
          tag_name: build-${{ github.sha }}
          name: Build ${{ github.sha }}
          prerelease: true
          files: |
            build/rclone-studip
            build/librcloneplugin_backend_studip.so
          fail_on_unmatched_files: true