From bd0b84dea96b8d7fb14f364795d8d138d77e6327 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:29:34 +0200 Subject: [PATCH 1/6] docs: add better input descriptions --- action.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index 9aa9473..3b02139 100644 --- a/action.yml +++ b/action.yml @@ -2,26 +2,38 @@ name: 'BlueBuild' description: 'Build a custom OS image' inputs: recipe: - description: 'recipe.yml file to build' + description: | + The [recipe](https://blue-build.org/reference/recipe/) file to build the image from, relative to the `config/` directory. required: true default: 'recipe.yml' - registry: - description: 'container registry to push image to (default: ghcr.io)' - required: false - default: 'ghcr.io' - registry_namespace: - description: 'namespace on registry to push to (example: ublue-os)' - required: false - default: ${{github.repository_owner}} cosign_private_key: - description: 'secret used to sign final image' + description: | + The Sigstore/cosign secret used to sign the image. required: true registry_token: - description: 'token used to sign into registry' + description: | + The token used to sign into the container registry. + + Example: `${{ github.token }}` required: true pr_event_number: - description: 'event number' + description: | + The event number used to tag images pushed from pull requests. + + Example: `${{ github.event.number }}` required: true + registry: + description: | + The container registry to push the built image to.' + required: false + default: 'ghcr.io' + registry_namespace: + description: | + The namespace on the registry to push to. + + Example: `ublue-os` + required: false + default: ${{ github.repository_owner }} runs: using: "composite" steps: From c82a16a91ca384083a4872d6348dce196f8291b0 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:32:31 +0200 Subject: [PATCH 2/6] docs: add example for cosign private key input desc --- action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action.yml b/action.yml index 3b02139..e505ef9 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,8 @@ inputs: cosign_private_key: description: | The Sigstore/cosign secret used to sign the image. + + Example: `${{ secrets.SIGNING_SECRET }}` required: true registry_token: description: | From b9784455ff6b0238567b486b21470ec4fa613031 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:35:13 +0200 Subject: [PATCH 3/6] docs: add mention of reference webpage in readme --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd3693f..0d101da 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # BlueBuild GitHub Action -This reusable Action can be used to build custom operating system images using BlueBuild tools. Check out the [template](https://github.com/blue-build/template) for an example of this Action in use. \ No newline at end of file +This reusable Action can be used to build custom operating system images using BlueBuild tools. Check out the [template](https://github.com/blue-build/template) for an example of this Action in use. Check out the [reference page](https://blue-build.org/reference/github-action/) on the website for the list of inputs with documentation. \ No newline at end of file diff --git a/action.yml b/action.yml index e505ef9..ec4168d 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ inputs: required: true registry: description: | - The container registry to push the built image to.' + The container registry to push the built image to. required: false default: 'ghcr.io' registry_namespace: From 117a659ca3ce9c9b34d623acec1d392736d8158a Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:47:12 +0200 Subject: [PATCH 4/6] feat: add release-please & multi-tag releases (#12) --- .github/workflows/release-please.yml | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..60d5123 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,45 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + release-type: simple + + # tag major and minor versions + - uses: actions/checkout@v4 + - name: tag major and minor versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" + git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} + + # upload action.yml to release + # this is used to generate versioned documentation + - name: upload action.yml to release + if: ${{ steps.release.outputs.release_created }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ steps.release.outputs.tag_name }} ./action.yml + + From c0cabfd6f6517e49a001ffbe2bd8d11d8d1af212 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:43:09 +0200 Subject: [PATCH 5/6] fix: builds failing due to input desc examples being evaluated by github --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index ec4168d..b99ffa3 100644 --- a/action.yml +++ b/action.yml @@ -10,19 +10,19 @@ inputs: description: | The Sigstore/cosign secret used to sign the image. - Example: `${{ secrets.SIGNING_SECRET }}` + Example: `\${{ secrets.SIGNING_SECRET }}` required: true registry_token: description: | The token used to sign into the container registry. - Example: `${{ github.token }}` + Example: `\${{ github.token }}` required: true pr_event_number: description: | The event number used to tag images pushed from pull requests. - Example: `${{ github.event.number }}` + Example: `\${{ github.event.number }}` required: true registry: description: | From 5d69b367446f05598400038a52eab06dc81bdf56 Mon Sep 17 00:00:00 2001 From: xynydev <60004820+xynydev@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:47:39 +0200 Subject: [PATCH 6/6] fix: builds failing due to input desc examples being evaluated by github this time by using the HTML entity for the dollar sign to display it, because escaping apparently doesn't work --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index b99ffa3..878e24d 100644 --- a/action.yml +++ b/action.yml @@ -10,19 +10,19 @@ inputs: description: | The Sigstore/cosign secret used to sign the image. - Example: `\${{ secrets.SIGNING_SECRET }}` + Example: `${{ secrets.SIGNING_SECRET }}` required: true registry_token: description: | The token used to sign into the container registry. - Example: `\${{ github.token }}` + Example: `${{ github.token }}` required: true pr_event_number: description: | The event number used to tag images pushed from pull requests. - Example: `\${{ github.event.number }}` + Example: `${{ github.event.number }}` required: true registry: description: |