Merge pull request #49 from zhongys-c8y/change-time #9
Workflow file for this run
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: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set version | |
| run: | | |
| echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
| echo "Package version: $VERSION" | |
| - name: Build with nfpm | |
| run: | | |
| mkdir -p dist | |
| docker run --rm -v $PWD:/tmp --env VERSION=${{ env.VERSION }} -w /tmp goreleaser/nfpm package \ | |
| --config /tmp/nfpm.yaml \ | |
| --target /tmp/dist \ | |
| --packager deb | |
| - name: Publish | |
| if: startsWith(github.ref, 'refs/tags/') && env.PUBLISH_TOKEN | |
| env: | |
| PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | |
| PUBLISH_REPO: ${{ secrets.PUBLISH_REPO }} | |
| PUBLISH_OWNER: ${{ secrets.PUBLISH_OWNER }} | |
| run: | | |
| ./ci/publish.sh ./dist --repo "$PUBLISH_REPO" --owner "$PUBLISH_OWNER" | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| generate_release_notes: true | |
| draft: true | |
| prerelease: false | |
| files: | |
| ./dist/tedge-modbus-plugin_*_all.deb |