@@ -15,28 +15,59 @@ jobs:
1515
1616 strategy :
1717 matrix :
18- go-version : [1.22.x]
1918 os : [ubuntu-latest]
19+ gotify-version : ["2.5.0", "2.6.1"]
2020
2121 steps :
2222 - name : Checkout source code
2323 uses : actions/checkout@v4
2424
25- - name : Set up Go
26- uses : actions/setup-go@v5
27- with :
28- go-version : ${{ matrix.go-version }}
25+ - name : Set up Docker Buildx
26+ uses : docker/setup-buildx-action@v3
2927
30- - name : Install required tools
31- run : |
32- go install github.com/gotify/plugin-api/cmd/gomod-cap@latest
33-
34- - name : Build the plugin
28+ - name : Build Plugin
29+ env :
30+ GOTIFY_VERSION : " ${{ matrix.gotify-version }}"
3531 run : |
32+ make download-tools
3633 make build
3734
3835 - name : Upload build artifacts
3936 uses : actions/upload-artifact@v4
4037 with :
41- name : telegram-plugin
38+ name : build-${{ matrix.gotify-version }}
4239 path : build/*.so
40+ release :
41+ name : Release Plugin
42+ runs-on : ubuntu-latest
43+ needs : build
44+ steps :
45+ - name : Checkout Code
46+ uses : actions/checkout@v4
47+
48+ - name : Download Build Artifacts
49+ uses : actions/download-artifact@v4
50+ with :
51+ path : build
52+ pattern : build-*
53+ merge-multiple : true
54+
55+ - run : ls -la build
56+
57+ - name : Tag the repository
58+ id : tag
59+ run : |
60+ # See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names
61+ TAG=v$(date -Iseconds | sed 's/[T:\+]/-/g')
62+ echo "$TAG"
63+ echo "tag=$TAG" >> $GITHUB_OUTPUT
64+ git config --global user.name "${GITHUB_ACTOR}"
65+ git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
66+ git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA}
67+ git push origin $TAG
68+
69+ - name : Create Release
70+ uses : softprops/action-gh-release@v2
71+ with :
72+ files : build/*.so
73+ tag_name : ${{ steps.tag.outputs.tag }}
0 commit comments