-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
013a15c
commit 158296a
Showing
17 changed files
with
156 additions
and
61,445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,6 @@ jobs: | |
name: Run Provider setup and tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
# - name: Set up Go | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: "1.21" | ||
|
||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -37,3 +32,76 @@ jobs: | |
run: | | ||
for dir in examples/*; do (ci/scripts/test-module.sh "$dir"); done | ||
# ci/scripts/test-module.sh examples/non-exclusive-queue | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.22" | ||
|
||
- name: Checkout generator | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: SolaceDev/broker-terraform-code-generator | ||
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT | ||
path: broker-terraform-code-generator | ||
ref: "main" | ||
|
||
- name: Build and install generator | ||
run: | | ||
pushd broker-terraform-code-generator | ||
go install . | ||
ls ~/go/bin | ||
popd | ||
- name: Generate provider code | ||
run: | | ||
SWAGGER_SPEC_NAME=`ls ci/swagger_spec` | ||
echo "Generating code using spec $SWAGGER_SPEC_NAME" | ||
rm ./*.tf | ||
SEMP_V2_SWAGGER_CONFIG_EXTENDED_JSON="ci/swagger_spec/$SWAGGER_SPEC_NAME" MODULE_TEMPLATE_FOLDER="internal/gen-template" ~/go/bin/broker-terraform-code-generator software-module | ||
- name: Add copyright headers where needed | ||
run: | | ||
go install github.com/google/addlicense@latest | ||
addlicense -c 'Solace Corporation. All rights reserved.' -v -l apache ./*.tf | ||
addlicense -c 'Solace Corporation. All rights reserved.' -v -l apache $(find ./examples -name "*.tf" -type f -print0 | xargs -0) | ||
- name: Ensure version reflects release candidate version | ||
run: | | ||
# only if ${GITHUB_REF_NAME} starts with 'v' or 'dev' and followed by a semver | ||
if [[ $GITHUB_REF_NAME =~ ^(v|dev)[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then | ||
VERSION=$(echo "${GITHUB_REF_NAME}" | cut -d'v' -f2) | ||
echo $VERSION > VERSION | ||
fi | ||
- name: Check changed files | ||
uses: tj-actions/verify-changed-files@v17 | ||
id: check-changed-files | ||
with: | ||
files: | | ||
!broker-terraform-code-generator | ||
- name: Run step only when any of the above files change. | ||
if: steps.check-changed-files.outputs.files_changed == 'true' | ||
run: | | ||
echo "Changed files: ${{ steps.check-changed-files.outputs.changed_files }}" | ||
- name: Commit back any updated source code | ||
if: steps.check-changed-files.outputs.files_changed == 'true' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
committer_name: GitHub Actions | ||
committer_email: [email protected] | ||
message: 'Updating generated source' | ||
add: ". ':!broker-terraform-code-generator'" | ||
new_branch: GeneratedSourceUpdates-${{ github.ref_name }} | ||
|
||
- name: Create pull request | ||
if: steps.check-changed-files.outputs.files_changed == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
CURRENT_BRANCH=${GITHUB_REF_NAME} | ||
gh pr create -B ${CURRENT_BRANCH} -H "GeneratedSourceUpdates-${CURRENT_BRANCH}" --title "Merge updates into ${CURRENT_BRANCH}" --body 'Created by Github action' | ||
echo Review and approve PR before push can continue | ||
exit 1 // force actions stop here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,14 @@ | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
prev_branch_name: | ||
description: 'Prev branch name, must start with v' | ||
required: true | ||
default: 'v0.1.0-rc.1' | ||
release_branch_name: | ||
description: 'Release branch name, must start with v' | ||
required: true | ||
default: 'v0.1.0-rc.1' | ||
default: 'v0.1.0-rc.2' | ||
|
||
|
||
jobs: | ||
|
@@ -16,7 +20,7 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.21" | ||
go-version: "1.22" | ||
|
||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
|
@@ -86,12 +90,26 @@ jobs: | |
echo Review and approve PR before release can continue | ||
exit 1 // force actions stop here | ||
- name: Create the release branch | ||
uses: peterjgrainger/[email protected] | ||
- name: Create release branch starting point | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
branch: "${{ github.event.inputs.release_branch_name }}" | ||
run: | | ||
git fetch | ||
git push origin refs/remotes/origin/${{ github.event.inputs.prev_branch_name }}:refs/heads/${{ github.event.inputs.release_branch_name }} | ||
- name: Create PR to release branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
CURRENT_BRANCH=${GITHUB_REF_NAME} | ||
gh pr create -B ${{ github.event.inputs.release_branch_name }} --title "New release ${{ github.event.inputs.release_branch_name }}" --body 'Created by Github action' | ||
# - name: Create PR to release branch | ||
# uses: peterjgrainger/[email protected] | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# branch: "${{ github.event.inputs.release_branch_name }}" | ||
|
||
# - name: Tag the release branch | ||
# if: env.NEXT_DEV_VERSION != '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0-rc.1 | ||
0.1.0-rc.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.