Skip to content

Adding a new "run dev" mode for easier development. #62

Adding a new "run dev" mode for easier development.

Adding a new "run dev" mode for easier development. #62

Workflow file for this run

# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (paultyng/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build-test-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- name: Set up Goreleaser
run: |
mkdir -p "${TMPDIR:?}"
curl -sL https://git.io/goreleaser | bash -s -- --version
env:
TMPDIR: ${{ github.workspace }}/bin
VERSION: v1.4.1
- name: Import GPG key
id: import_gpg
uses: paultyng/ghaction-import-gpg@v2.1.0
if: env.GPG_PRIVATE_KEY != '' && env.PASSPHRASE != ''
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Build and sign
run: ./run build --sign
if: steps.import_gpg.outputs.fingerprint != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_BIN: ${{ github.workspace }}/bin/goreleaser
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Build
run: ./run build
if: steps.import_gpg.outputs.fingerprint == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_BIN: ${{ github.workspace }}/bin/goreleaser
- name: Test
run: ./run test
- name: Intergration Test
run: ./run dev test-integration
if: env.HEALTHCHECKSIO_API_KEY != ''
env:
HEALTHCHECKSIO_API_KEY: ${{ secrets.HEALTHCHECKSIO_API_KEY }}
- name: Release on valid tag
if: github.repository == 'kristofferahl/terraform-provider-healthchecksio' && startsWith(github.ref, 'refs/tags/v')
run: ./run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_BIN: ${{ github.workspace }}/bin/goreleaser
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}