-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add create release draft github action #180
Open
denise89p
wants to merge
1
commit into
main
Choose a base branch
from
github-action-create-release-tag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- 'feat' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
- title: '🔨 Refactor' | ||
label: 'refactor' | ||
- title: '💯 Tests' | ||
label: 'test' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
autolabeler: | ||
- label: 'feature' | ||
title: | ||
- '/^feat:.+/' | ||
- label: 'fix' | ||
title: | ||
- '/^fix:.+/' | ||
- label: 'chore' | ||
title: | ||
- '/^chore:.+/' | ||
- label: 'refactor' | ||
title: | ||
- '/^refactor:.+/' | ||
- label: 'test' | ||
title: | ||
- '/^test:.+/' | ||
template: | | ||
## Changes | ||
|
||
$CHANGES |
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 |
---|---|---|
@@ -0,0 +1,180 @@ | ||
# ./.github/workflows/staging-auto-pr.yaml | ||
name: create draft release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
beta_version: | ||
required: false | ||
default: false | ||
description: beta version | ||
publish_release: | ||
required: false | ||
default: false | ||
description: publish release | ||
|
||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }} | ||
|
||
jobs: | ||
run-regressions: | ||
name: run regressions tesing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Run full regressions tests" | ||
run: "echo full regressions tests...." | ||
|
||
update-readme: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: run-regressions | ||
name: update weka version | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: dev | ||
fetch-depth: 0 | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version | ||
id: tag_version | ||
env: | ||
WITH_V: false | ||
PRERELEASE: ${{ inputs.beta_version }} | ||
DRY_RUN: true | ||
|
||
- name: Find and Replace | ||
if: ${{ inputs.beta_version != 'true' }} | ||
run: sed -i -e '/version.*=/ s/= .*/= "${{ steps.tag_version.outputs.new_tag }}"/' README.md | ||
|
||
- name: Commit README.md file | ||
if: ${{ inputs.beta_version != 'true' }} | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Github Actions" | ||
git commit -a -m "refactor: Update README file with new weka tag version (auto github action)" | ||
|
||
- name: Push README.md file changes | ||
if: ${{ inputs.beta_version != 'true' }} | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: dev | ||
|
||
create-pull-request: | ||
name: open pr to main | ||
runs-on: ubuntu-latest | ||
needs: update-readme | ||
steps: | ||
- uses: actions/checkout@v3 | ||
name: checkout | ||
with: | ||
fetch-depth: 0 | ||
ref: dev | ||
|
||
- uses: repo-sync/pull-request@v2 | ||
name: pull-request | ||
id: pr | ||
with: | ||
destination_branch: "main" | ||
pr_title: "Create PR from ${{ github.ref }} into main" | ||
pr_body: "*An automated PR*, rebase dev to main" | ||
pr_draft: false | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: automatic rebase | ||
uses: cirrus-actions/[email protected] | ||
env: | ||
PR_NUMBER: ${{ steps.pr.outputs.pr_number }} | ||
|
||
- name: add label | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
env: | ||
issue_number: ${{ steps.pr.outputs.pr_number }} | ||
with: | ||
labels: automerge | ||
number: ${{ steps.pr.outputs.pr_number }} | ||
|
||
- id: automerge | ||
name: automerge | ||
uses: "pascalgn/[email protected]" | ||
|
||
create-tag: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: create-pull-request | ||
name: create tag | ||
outputs: | ||
new_tag: ${{ steps.tag_version.outputs.new_tag }} | ||
tag: ${{ steps.tag_version.outputs.tag }} | ||
changelog: ${{ steps.tag_version.outputs.changelog }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version | ||
id: tag_version | ||
env: | ||
WITH_V: true | ||
PRERELEASE: ${{ inputs.beta_version }} | ||
|
||
create-release: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
needs: create-tag | ||
name: create release | ||
outputs: | ||
url: ${{ steps.release_draft.outputs.html_url }} | ||
steps: | ||
- id: release_draft | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
#disable-autolabeler: false | ||
publish: ${{ inputs.publish_release }} | ||
version: ${{ needs.create-tag.outputs.new_tag }} | ||
|
||
on-failure: | ||
if: ${{ always() && contains(needs.*.result, 'failure') }} | ||
needs: [create-pull-request, create-tag, create-release] | ||
runs-on: ubuntu-latest | ||
name: revert commit on fail job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: dev | ||
fetch-depth: '0' | ||
|
||
- name: Undo Push | ||
uses: exions/undo-push@v1 | ||
with: | ||
branch: dev | ||
|
||
notify-slack: | ||
runs-on: ubuntu-latest | ||
needs: [ create-release, create-tag ] | ||
name: slack notification | ||
steps: | ||
- name: Determine create tag or release tag | ||
uses: haya14busa/action-cond@v1 | ||
id: option_creation | ||
with: | ||
cond: ${{ github.event.inputs.publish_release == 'true' }} | ||
if_true: 'Tag' # string value | ||
if_false: 'Draft' | ||
|
||
- name: Report Status | ||
if: always() | ||
uses: ravsamhq/notify-slack-action@v2 | ||
with: | ||
status: ${{ job.status }} | ||
notification_title: Create Release ${{ steps.option_creation.outputs.value }} ${{ needs.create-tag.outputs.tag }}, link ${{ needs.create-release.outputs.url }} | ||
notify_when: 'success' | ||
footer: "" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure, but maybe we will need to create a beta version for qa