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

separate tag creation jobs #238

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 31 deletions .github/workflows/autorelease-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,8 @@ on:
- cron: "0 0 * * 0"

jobs:
version:
create_tag_and_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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

- name: Set up Go
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
uses: actions/setup-go@v4
with:
go-version: 1.20.x

- name: Bump version and push
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
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
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add cmd/mapcidr/main.go -f
git commit -am "Bump version"
git push origin HEAD:${{ github.ref }}

create:
runs-on: ubuntu-latest
needs: version
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Bump Version

on:
workflow_dispatch:
schedule:
- cron: "55 23 * * 0"

jobs:
version_bump:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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

- name: Set up Go
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
uses: actions/setup-go@v4
with:
go-version: 1.20.x

- name: Bump version and push
if: ${{ steps.get_commit.outputs.COMMIT_COUNT > 0 }}
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
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add cmd/mapcidr/main.go -f
git commit -am "Bump version"
git push origin HEAD:${{ github.ref }}