-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from im-practices/version-updates3
ARCH-2035 - Updating to latest versions of actions
- Loading branch information
Showing
31 changed files
with
1,903 additions
and
1,903 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
114 changes: 57 additions & 57 deletions
114
workflow-templates/im-build-increment-version-on-merge.yml
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,57 +1,57 @@ | ||
# Workflow Code: AngryGoose_v14 DO NOT REMOVE | ||
# Purpose: | ||
# Automatically calculates the next semantic version and creates a tag on the repository | ||
# when a PR is merged. The tag is used in later workflows to deploy the tf or db. | ||
# | ||
# Note: | ||
# This workflow should not be used to tag repos that have CI workflows that create their own releases, like | ||
# the dotnet ci build because this workflow would conflict with that. This workflow is recommended for | ||
# things like infrastructure repositories or database projects that do not have a CI build which increments | ||
# their versions. | ||
# | ||
# Frequency: | ||
# This workflow should only be used once per repository | ||
# If the repo has multiple projects that need this workflow (like db and tf), multiple tags can be generated with | ||
# with this workflow by duplicating the increment version step and including different 'tag-prefix' args. | ||
# | ||
# Projects to use this Template with: | ||
# - Azure SQL Database (Core Template) | ||
# - On-Prem Database (Core Template) | ||
# - Storage Account Deployments (Core Template) | ||
# - Terraform (Core Template) | ||
|
||
name: Increment Version on Merge | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
increment-version: | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' # TODO: verify default branch name | ||
|
||
runs-on: ubuntu-latest # Force this to run on github-hosted runner by using a tag that does not exist on self-hosted runners | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
# Because this is running only on merged PRs, the default behavior of always checking out the merge commit is correct here. | ||
|
||
# See https://github.com/im-open/git-version-lite for more details around how to increment major/minor/patch through commit messages | ||
- name: Increment the version | ||
id: calculate_version | ||
uses: im-open/[email protected] | ||
with: | ||
default-release-type: major # This means if the action cannot find a tag, it will start at v1.0.0 | ||
|
||
- name: Create version tag on GitHub | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ steps.calculate_version.outputs.NEXT_VERSION}}', | ||
sha: context.sha // context.sha is the SHA of the merge commit | ||
}) | ||
# Workflow Code: AngryGoose_v15 DO NOT REMOVE | ||
# Purpose: | ||
# Automatically calculates the next semantic version and creates a tag on the repository | ||
# when a PR is merged. The tag is used in later workflows to deploy the tf or db. | ||
# | ||
# Note: | ||
# This workflow should not be used to tag repos that have CI workflows that create their own releases, like | ||
# the dotnet ci build because this workflow would conflict with that. This workflow is recommended for | ||
# things like infrastructure repositories or database projects that do not have a CI build which increments | ||
# their versions. | ||
# | ||
# Frequency: | ||
# This workflow should only be used once per repository | ||
# If the repo has multiple projects that need this workflow (like db and tf), multiple tags can be generated with | ||
# with this workflow by duplicating the increment version step and including different 'tag-prefix' args. | ||
# | ||
# Projects to use this Template with: | ||
# - Azure SQL Database (Core Template) | ||
# - On-Prem Database (Core Template) | ||
# - Storage Account Deployments (Core Template) | ||
# - Terraform (Core Template) | ||
|
||
name: Increment Version on Merge | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
increment-version: | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' # TODO: verify default branch name | ||
|
||
runs-on: ubuntu-latest # Force this to run on github-hosted runner by using a tag that does not exist on self-hosted runners | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# Because this is running only on merged PRs, the default behavior of always checking out the merge commit is correct here. | ||
|
||
# See https://github.com/im-open/git-version-lite for more details around how to increment major/minor/patch through commit messages | ||
- name: Increment the version | ||
id: calculate_version | ||
uses: im-open/[email protected] | ||
with: | ||
default-release-type: major # This means if the action cannot find a tag, it will start at v1.0.0 | ||
|
||
- name: Create version tag on GitHub | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ steps.calculate_version.outputs.NEXT_VERSION}}', | ||
sha: context.sha // context.sha is the SHA of the merge commit | ||
}) |
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.