Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version bump steps #232

Merged
merged 5 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions .github/workflows/autorelease-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🔖 Auto release gh action
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"

jobs:
build:
Expand All @@ -13,7 +13,33 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0


- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x

- name: Bump version
run: |
curl -LO https://raw.githubusercontent.com/projectdiscovery/utils/main/scripts/versionbump/versionbump.go
go run versionbump.go -file cmd/mapcidr/main.go -var version -part patch

- name: Create local changes
run: |
git add cmd/mapcidr/main.go

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -am "Bump version"

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Get Commit Count
id: get_commit
run: git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count | xargs -I {} echo COMMIT_COUNT={} >> $GITHUB_OUTPUT
Expand All @@ -33,4 +59,4 @@ jobs:
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
body: ${{ steps.tag_version.outputs.changelog }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.devcontainer
mapcidr
cmd/mapcidr/mapcidr
cmd/integration-test/mapcidr
Expand Down