name: release-plugin-destination-sqlite on: push: tags: - "plugins-destination-sqlite-v*.*.*" jobs: release-plugin-binary-destination-sqlite: timeout-minutes: 30 runs-on: ubuntu-latest container: image: ghcr.io/cloudquery/golang-cross:v10.0.0 steps: # Tag format is plugins--- - name: Split tag id: split run: | tag=${{ github.ref_name }} plugin_version=$(echo $tag | cut -d- -f4-) echo "plugin_version=${plugin_version}" >> $GITHUB_OUTPUT # Fail if not a valid SemVer string - name: Parse semver string uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3 id: semver_parser with: input_string: ${{steps.split.outputs.plugin_version}} - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 2 - uses: actions/cache@v4 with: path: | ~/.cache/go-build ~/go/pkg/mod key: ${{ runner.os }}-go-1.22.4-release-cache-${{ hashFiles('plugins/destination/sqlite/go.sum') }} restore-keys: | ${{ runner.os }}-go-1.22.4-release-cache-plugins-destination-sqlite - name: Set up Go 1.x uses: actions/setup-go@v5 with: go-version-file: plugins/destination/sqlite/go.mod cache: false - name: Install GoReleaser uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser-pro version: latest install-only: true - name: Run GoReleaser Dry-Run run: goreleaser release --clean --skip=validate,publish,sign -f ./plugins/destination/sqlite/.goreleaser.yaml env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} GORELEASER_CURRENT_TAG: ${{ github.ref_name }} - name: Run GoReleaser run: goreleaser release --clean -f ./plugins/destination/sqlite/.goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} GORELEASER_CURRENT_TAG: ${{ github.ref_name }} - name: Update version file if: steps.semver_parser.outputs.prerelease == '' run: 'echo "{ \"latest\": \"${{github.ref_name}}\" }" > ./website/versions/destination-sqlite.json' - name: Create Pull Request if: steps.semver_parser.outputs.prerelease == '' uses: peter-evans/create-pull-request@v4 with: # required so the PR triggers workflow runs token: ${{ secrets.GH_CQ_BOT }} branch: chore/update-plugin-destination-sqlite-version base: main title: "chore: Update plugin `destination-sqlite` version to ${{steps.split.outputs.plugin_version}}" commit-message: "chore: Update plugin `destination-sqlite` version to ${{steps.split.outputs.plugin_version}}" body: Updates the `destination-sqlite` plugin latest version to ${{steps.split.outputs.plugin_version}} labels: automerge author: cq-bot