-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions <[email protected]>
- Loading branch information
1 parent
dd58038
commit 27fbe42
Showing
6 changed files
with
38 additions
and
26 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.19.0 | ||
# devctl@5.21.0 | ||
# | ||
name: Create Release | ||
on: | ||
|
@@ -122,22 +122,22 @@ jobs: | |
fi | ||
- name: Set up git identity | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "taylorbot" | ||
- name: Commit changes | ||
run: | | ||
file="${{ needs.gather_facts.outputs.project_go_path }}" | ||
git add $file | ||
git commit -m "Bump version to ${{ steps.update_project_go.outputs.new_version }}" | ||
- name: Push changes | ||
env: | ||
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | ||
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git" | ||
branch: "${{ github.ref }}-version-bump" | ||
run: | | ||
git push "${REMOTE_REPO}" HEAD:${{ env.branch }} | ||
- name: Create PR | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}" | ||
base: "${{ github.ref }}" | ||
branch: "${{ github.ref }}-version-bump" | ||
version: "${{ needs.gather_facts.outputs.version }}" | ||
|
@@ -171,22 +171,22 @@ jobs: | |
path: ./CHANGELOG.md | ||
- name: Set up git identity | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "taylorbot" | ||
- name: Create tag | ||
run: | | ||
version="${{ needs.gather_facts.outputs.version }}" | ||
git tag "v$version" ${{ github.sha }} | ||
- name: Push tag | ||
env: | ||
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | ||
REMOTE_REPO: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git" | ||
run: | | ||
git push "${REMOTE_REPO}" --tags | ||
- name: Create release | ||
id: create_gh_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}" | ||
with: | ||
body: ${{ steps.changelog_reader.outputs.changes }} | ||
tag_name: "v${{ needs.gather_facts.outputs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.19.0 | ||
# devctl@5.21.0 | ||
# | ||
name: Create Release PR | ||
on: | ||
|
@@ -44,7 +44,7 @@ jobs: | |
repo_name: ${{ steps.gather_facts.outputs.repo_name }} | ||
branch: ${{ steps.gather_facts.outputs.branch }} | ||
base: ${{ steps.gather_facts.outputs.base }} | ||
is_major: ${{ steps.gather_facts.outputs.is_major }} | ||
needs_major_bump: ${{ steps.gather_facts.outputs.needs_major_bump }} | ||
skip: ${{ steps.pr_exists.outputs.skip }} | ||
version: ${{ steps.gather_facts.outputs.version }} | ||
steps: | ||
|
@@ -65,7 +65,7 @@ jobs: | |
version="$(echo $head | awk -F# '{print $NF}')" | ||
if [[ $version =~ ^major|minor|patch$ ]]; then | ||
gh auth login --with-token <<<$(echo -n ${{ secrets.GITHUB_TOKEN }}) | ||
gh auth login --with-token <<<$(echo -n ${{ secrets.TAYLORBOT_GITHUB_ACTION }}) | ||
gh_api_get_latest_release_version() | ||
{ | ||
if ! version="$(gh api "repos/$1/releases/latest" --jq '.tag_name[1:] | split(".") | .[0], .[1], .[2]')" | ||
|
@@ -94,7 +94,9 @@ jobs: | |
version_major=$((version_major+1)) | ||
version_minor=0 | ||
version_patch=0 | ||
echo "is_major=true" >> $GITHUB_OUTPUT | ||
if [[ "${version_major}" != "1" ]]; then | ||
echo "needs_major_bump=true" >> $GITHUB_OUTPUT | ||
fi | ||
;; | ||
*) | ||
echo "Unknown Semver level provided" | ||
|
@@ -109,8 +111,8 @@ jobs: | |
version_patch=$(echo "${version}" | cut -d "." -f 3) | ||
# This will help us detect versions with suffixes as majors, i.e 3.0.0-alpha1. | ||
# Even though it's a pre-release, it's still a major. | ||
if [[ $version_minor = 0 && $version_patch =~ ^0.* ]]; then | ||
echo "is_major=true" >> $GITHUB_OUTPUT | ||
if [[ $version_minor = 0 && $version_patch =~ ^0.* && $version_major != 1 ]]; then | ||
echo "needs_major_bump=true" >> $GITHUB_OUTPUT | ||
fi | ||
fi | ||
repo_name="$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" | ||
|
@@ -122,10 +124,12 @@ jobs: | |
- name: Check if PR exists | ||
id: pr_exists | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}" | ||
run: | | ||
if gh pr view --repo ${{ github.repository }} ${{ steps.gather_facts.outputs.branch }} | grep -i 'state:[[:space:]]*open' >/dev/null; then | ||
gh pr view --repo ${{ github.repository }} ${{ steps.gather_facts.outputs.branch }} | ||
head="${{ steps.gather_facts.outputs.branch }}" | ||
branch="${head#refs/heads/}" # Strip "refs/heads/" prefix. | ||
if gh pr view --repo "${{ github.repository }}" "${branch}" --json state --jq .state | grep -i 'open' > /dev/null; then | ||
gh pr view --repo "${{ github.repository }}" "${branch}" | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "skip=false" >> $GITHUB_OUTPUT | ||
|
@@ -198,14 +202,14 @@ jobs: | |
- name: Bump go module defined in go.mod if needed | ||
run: | | ||
if [ "${{ needs.gather_facts.outputs.is_major }}" = true ] && test -f "go.mod"; then | ||
if [ "${{ needs.gather_facts.outputs.needs_major_bump }}" = true ] && test -f "go.mod"; then | ||
go install github.com/marwan-at-work/mod/cmd/[email protected] | ||
mod upgrade | ||
fi | ||
- name: Set up git identity | ||
run: | | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "taylorbot" | ||
- name: Create release commit | ||
env: | ||
version: "${{ needs.gather_facts.outputs.version }}" | ||
|
@@ -214,12 +218,12 @@ jobs: | |
git commit -m "Release v${{ env.version }}" | ||
- name: Push changes | ||
env: | ||
remote_repo: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | ||
remote_repo: "https://${{ github.actor }}:${{ secrets.TAYLORBOT_GITHUB_ACTION }}@github.com/${{ github.repository }}.git" | ||
run: | | ||
git push "${remote_repo}" HEAD:${{ needs.gather_facts.outputs.branch }} | ||
- name: Create PR | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.TAYLORBOT_GITHUB_ACTION }}" | ||
base: "${{ needs.gather_facts.outputs.base }}" | ||
version: "${{ needs.gather_facts.outputs.version }}" | ||
run: | | ||
|
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,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.19.0 | ||
# devctl@5.21.0 | ||
# | ||
name: gitleaks | ||
|
||
|
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,6 +1,6 @@ | ||
# DO NOT EDIT. Generated with: | ||
# | ||
# devctl@5.19.0 | ||
# devctl@5.21.0 | ||
# | ||
|
||
include Makefile.*.mk | ||
|
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