Recipes

Sample directory structure

dependabot.yml

Docs

version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"

Run gradle test

name: Test

on:
  push:
    branches:
      - main
      - master
    paths-ignore:
      - "*.md"
  pull_request:
    branches:
      - main
      - master
    paths-ignore:
      - "*.md"

jobs:
  test:
    uses: itzg/github-workflows/.github/workflows/gradle-build.yml@main
    with: 
      arguments: test
      include-test-report: true

If NodeJS support is needed, add

  include-node-js: true

and adjust npm-cache-dependency-path, if needed.

Release application build to GitHub and publish

Uses io.github.itzg.github-releaser plugin

name: Release and publish

on:
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"
      - "[0-9]+.[0-9]+.[0-9]+-*"
  workflow_dispatch:

jobs:
  publish:
    uses: itzg/github-workflows/.github/workflows/gradle-build.yml@main
    with:
      arguments: >
        test 
        githubPublishApplication
      scoop-bucket-repo: itzg/scoop-bucket
      homebrew-tap-repo: itzg/homebrew-tap
    secrets:
      GITHUB_PUBLISH_TOKEN: ${{ secrets.PUSH_ACCESS_GITHUB_TOKEN }}

If NodeJS support is needed, add

  include-node-js: true

and adjust npm-cache-dependency-path, if needed.

Release gradle plugin

name: Publish

on:
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"

jobs:
  publish:
    uses: itzg/github-workflows/.github/workflows/publish-gradle-plugin.yml@main
    secrets:
      plugin-portal-key: ${{ secrets.PLUGIN_PORTAL_KEY }}
      plugin-portal-secret: ${{ secrets.PLUGIN_PORTAL_SECRET }}

Simple Boot Image to GHCR

name: "Build image"
on:
  push:
    branches:
      - main
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"

jobs:
  build:
    uses: itzg/github-workflows/.github/workflows/simple-boot-image-to-ghcr.yml@main
    with:
      image-repo: "ghcr.io/itzg"
      image-platforms: "linux/amd64,linux/arm64"
      extra-gradle-tasks: test

If NodeJS support is needed, add

  include-node-js: true

and adjust npm-cache-dependency-path, if needed.

Go test with optional goreleaser

    uses: itzg/github-workflows/.github/workflows/go-test.yml@main

Go release with goreleaser including image

    uses: itzg/github-workflows/.github/workflows/go-with-releaser-image.yml@main
    secrets:
      image-registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
      image-registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
      # optional
      scoop-tap-github-token: ${{ secrets.SCOOP_BUCKET_GITHUB_TOKEN }}

NOTE The repository.token in .goreleaser.yaml needs to be configured as

      token: "{{ .Env.SCOOP_TAP_GITHUB_TOKEN }}"

Go release with goreleaser

    uses: itzg/github-workflows/.github/workflows/go-with-releaser.yml@main

NOTE The repository.token in .goreleaser.yaml needs to be configured as

      token: "{{ .Env.SCOOP_TAP_GITHUB_TOKEN }}"