ci: use docker build instead #31
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: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| gotify-version: ["2.5.0", "2.6.1"] | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Plugin | |
| env: | |
| GOTIFY_VERSION: "${{ matrix.gotify-version }}" | |
| run: | | |
| make download-tools | |
| make build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-${{ matrix.gotify-version }} | |
| path: build/*.so | |
| release: | |
| name: Release Plugin | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: build | |
| pattern: build-* | |
| merge-multiple: true | |
| - run: ls -la build | |
| - name: Tag the repository | |
| id: tag | |
| run: | | |
| # See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names | |
| TAG=v$(date -Iseconds | sed 's/[T:\+]/-/g') | |
| echo "$TAG" | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| git config --global user.name "${GITHUB_ACTOR}" | |
| git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA} | |
| git push origin $TAG | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: build/*.so | |
| tag_name: ${{ steps.tag.outputs.tag }} |