Skip to content

Notify Integration Release (Tag) #28

Notify Integration Release (Tag)

Notify Integration Release (Tag) #28

name: Notify Integration Release (Tag)
on:
push:
tags:
- '*.*.*' # Proper releases
jobs:
strip-version:
runs-on: ubuntu-latest
outputs:
packer-version: ${{ steps.strip.outputs.packer-version }}
steps:
- name: Strip leading v from version tag
id: strip
env:
REF: ${{ github.ref_name }}
run: |
echo "packer-version=$(echo "$REF" | sed -E 's/v?([0-9]+\.[0-9]+\.[0-9]+)/\1/')" >> "$GITHUB_OUTPUT"
notify-release:
needs:
- strip-version
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/[email protected]
with:
ref: ${{ github.ref }}
# Ensure that Docs are Compiled
- uses: actions/[email protected]
with:
go-version: '>=1.22'
- shell: bash
run: make generate
# Ensure compiled docs get committed, otherwise uncommitted check fails
- uses: actions/[email protected]
- run: |
date > generated.txt
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch
git checkout main
git add .
git commit -m "commit any updated files"
git push origin main
- shell: bash
run: |
uncommitted="$(git status -s)"
if [[ -z "$uncommitted" ]]; then
echo "OK"
else
echo "Docs have been updated, but the compiled docs have not been committed."
echo "Run 'make generate', and commit the result to resolve this error."
echo "Generated but uncommitted files:"
echo "$uncommitted"
exit 1
fi
# Perform the Release
#
#- name: Checkout integration-release-action
# uses: actions/[email protected]
# with:
# repository: hashicorp/integration-release-action
# path: ./integration-release-action
#- name: Notify Release
# uses: ./integration-release-action
# with:
# The integration identifier will be used by the Packer team to register the integration
# the expected format is packer/<GitHub Org Name>/<plugin-name>
# integration_identifier: "packer/hashicorp/artifactory"
# release_version: ${{ needs.strip-version.outputs.packer-version }}
# release_sha: ${{ github.ref }}
# github_token: ${{ secrets.GITHUB_TOKEN }}