-
Notifications
You must be signed in to change notification settings - Fork 93
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
create github actions #124
Closed
Closed
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1bbcb9f
create github actions
Emrichardsone 383715a
remove grails discussion as contact link
Emrichardsone f753479
remove missed line from removing grails-core/discussion info
Emrichardsone dc19e5b
remove unnecessary workflows
Emrichardsone ccc4789
Remove some more workflows
guillermocalvo 050d68d
Update workflows
guillermocalvo ba15cad
Clean up
guillermocalvo 917c991
Apply suggestions from code review
guillermocalvo 910ab98
Apply suggestions from code review
guillermocalvo 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
Binary file not shown.
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,60 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for reporting an issue for Grails framework, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed. | ||
|
||
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/grails) or Slack (https://slack-signup.grails.org). DO NOT use the issue tracker to ask questions. | ||
- type: textarea | ||
attributes: | ||
label: Expected Behavior | ||
description: A concise description of what you expected to happen. | ||
placeholder: Tell us what should happen | ||
validations: | ||
required: false | ||
- type: textarea | ||
attributes: | ||
label: Actual Behaviour | ||
description: A concise description of what you're experiencing. | ||
placeholder: Tell us what happens instead | ||
validations: | ||
required: false | ||
- type: textarea | ||
attributes: | ||
label: Steps To Reproduce | ||
description: Steps to reproduce the behavior. | ||
placeholder: | | ||
1. In this environment... | ||
2. With this config... | ||
3. Run '...' | ||
4. See error... | ||
validations: | ||
required: false | ||
- type: textarea | ||
attributes: | ||
label: Environment Information | ||
description: Environment information where the problem occurs. | ||
placeholder: | | ||
- Operating System: | ||
- JDK Version: | ||
validations: | ||
required: false | ||
- type: input | ||
id: example | ||
attributes: | ||
label: Example Application | ||
description: Example application link. | ||
placeholder: | | ||
Link to GitHub repository with an example that reproduces the issue | ||
validations: | ||
required: false | ||
- type: input | ||
id: version | ||
attributes: | ||
label: Version | ||
description: Grails version | ||
validations: | ||
required: true | ||
|
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,7 @@ | ||
contact_links: | ||
- name: Stack Overflow | ||
url: https://stackoverflow.com/tags/grails | ||
about: Ask questions on Stack Overflow | ||
- name: Grails Slack | ||
url: https://grails.slack.com/ | ||
about: Chat with us on Grails Community Slack. |
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,14 @@ | ||
name: Feature request | ||
description: Create a new feature request | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Please describe the feature you want for Grails® framework to implement, before that check if there is already an existing issue to add it. | ||
- type: textarea | ||
attributes: | ||
label: Feature description | ||
placeholder: Tell us more about the feature you would like for Grails® framework to have and what problem is it going to solve | ||
validations: | ||
required: true | ||
|
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,9 @@ | ||
name: Other | ||
description: Something different | ||
body: | ||
- type: textarea | ||
attributes: | ||
label: Issue description | ||
validations: | ||
required: true | ||
|
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,10 @@ | ||
# Container image that runs your code | ||
FROM alpine:20231219 | ||
|
||
RUN apk add --no-cache curl jq git bash | ||
|
||
# Copies your code file from your action repository to the filesystem path `/` of the container | ||
COPY *.sh / | ||
|
||
# Code file to execute when the docker container starts up (`entrypoint.sh`) | ||
ENTRYPOINT ["/entrypoint.sh"] |
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,11 @@ | ||
# Grails post-release action | ||
|
||
Performs some actions after doing a release | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: grails/post-release@master | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
``` |
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,12 @@ | ||
name: 'Grails post-release action' | ||
description: 'Performs some actions after doing a release' | ||
inputs: | ||
token: | ||
description: 'GitHub token to authenticate the requests' | ||
required: true | ||
default: ${{ github.token }} | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.token }} |
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,89 @@ | ||
#!/bin/bash | ||
# $1 == GH_TOKEN | ||
|
||
if [ -z "$SNAPSHOT_SUFFIX" ]; then | ||
SNAPSHOT_SUFFIX="-SNAPSHOT" | ||
fi | ||
|
||
if [ -n "$MICRONAUT_BUILD_EMAIL" ]; then | ||
GIT_USER_EMAIL=$MICRONAUT_BUILD_EMAIL | ||
fi | ||
|
||
if [ -z "$GIT_USER_EMAIL" ]; then | ||
GIT_USER_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com" | ||
fi | ||
|
||
if [ -z "$GIT_USER_NAME" ]; then | ||
GIT_USER_NAME="grails-build" | ||
fi | ||
|
||
echo -n "Determining release version: " | ||
if [ -z "$RELEASE_VERSION" ]; then | ||
release_version=${GITHUB_REF:11} | ||
else | ||
release_version=${RELEASE_VERSION} | ||
fi | ||
echo $release_version | ||
|
||
echo -n "Determining next version: " | ||
next_version=`/increment_version.sh -p $release_version` | ||
echo $next_version | ||
echo "next_version=${next_version}" >> $GITHUB_OUTPUT | ||
|
||
echo "Configuring git" | ||
git config --global user.email "$GIT_USER_EMAIL" | ||
git config --global user.name "$GIT_USER_NAME" | ||
git config --global --add safe.directory /github/workspace | ||
git fetch | ||
|
||
echo -n "Determining target branch: " | ||
if [ -z "$TARGET_BRANCH" ]; then | ||
target_branch=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
else | ||
target_branch=${TARGET_BRANCH} | ||
fi | ||
echo $target_branch | ||
git checkout $target_branch | ||
|
||
echo -n "Retrieving current milestone number: " | ||
milestone_number=`curl -s https://api.github.com/repos/$GITHUB_REPOSITORY/milestones | jq -c ".[] | select (.title == \"$release_version\") | .number" | sed -e 's/"//g'` | ||
echo $milestone_number | ||
|
||
echo "Closing current milestone" | ||
curl -s --request PATCH -H "Authorization: Bearer $1" -H "Content-Type: application/json" https://api.github.com/repos/$GITHUB_REPOSITORY/milestones/$milestone_number --data '{"state":"closed"}' | ||
|
||
echo "Getting issues closed" | ||
issues_closed=`curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/issues?milestone=$milestone_number&state=closed" | jq '.[] | "* \(.title) (#\(.number))"' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
echo $issues_closed | ||
|
||
echo -n "Getting release url: " | ||
release_url=`cat $GITHUB_EVENT_PATH | jq '.release.url' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
echo $release_url | ||
|
||
echo -n "Getting release body: " | ||
release_body=`cat $GITHUB_EVENT_PATH | jq '.release.body' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
echo $release_body | ||
|
||
echo -n "Updating release body: " | ||
release_body="${release_body}\r\n${issues_closed}" | ||
echo $release_body | ||
curl -i --request PATCH -H "Authorization: Bearer $1" -H "Content-Type: application/json" $release_url --data "{\"body\": \"$release_body\"}" | ||
|
||
echo "Creating new milestone" | ||
curl -s --request POST -H "Authorization: Bearer $1" -H "Content-Type: application/json" "https://api.github.com/repos/$GITHUB_REPOSITORY/milestones" --data "{\"title\": \"$next_version\"}" | ||
|
||
echo "Setting new snapshot version" | ||
sed -i "s/^projectVersion.*$/projectVersion\=${next_version}$SNAPSHOT_SUFFIX/" gradle.properties | ||
sed -i "s/assertEquals(\".*$/assertEquals(\"${next_version}$SNAPSHOT_SUFFIX\", GrailsUtil.getGrailsVersion());/" grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
sed -n "/assertEquals(\".*/p" grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
cat gradle.properties | ||
|
||
echo "Committing and pushing" | ||
git add gradle.properties | ||
git add grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
git commit -m "Back to ${next_version}$SNAPSHOT_SUFFIX" | ||
git push origin $target_branch | ||
|
||
echo "Setting release version back so that Maven Central sync can work" | ||
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | ||
cat gradle.properties |
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,47 @@ | ||
#!/bin/bash | ||
|
||
# Increment a version string using Semantic Versioning (SemVer) terminology. | ||
# Source: https://github.com/fmahnke/shell-semver | ||
|
||
# Parse command line options. | ||
|
||
while getopts ":Mmp" Option | ||
do | ||
case $Option in | ||
M ) major=true;; | ||
m ) minor=true;; | ||
p ) patch=true;; | ||
esac | ||
done | ||
|
||
shift $(($OPTIND - 1)) | ||
|
||
version=$1 | ||
|
||
# Build array from version string. | ||
|
||
a=( ${version//./ } ) | ||
|
||
# Increment version numbers as requested. | ||
|
||
if [ ! -z $major ] | ||
then | ||
((a[0]++)) | ||
a[1]=0 | ||
a[2]=0 | ||
fi | ||
|
||
if [ ! -z $minor ] | ||
then | ||
((a[1]++)) | ||
a[2]=0 | ||
fi | ||
|
||
if [ ! -z $patch ] && ! [[ "${a[2]}" =~ M.*|RC.* ]] && ! [[ "${a[3]}" =~ ^M.*|^RC.* ]] | ||
then | ||
((a[2]++)) | ||
else | ||
a[2]=0 | ||
fi | ||
|
||
echo "${a[0]}.${a[1]}.${a[2]}" |
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,10 @@ | ||
# Container image that runs your code | ||
FROM alpine:20231219 | ||
|
||
RUN apk add --no-cache curl jq git bash | ||
|
||
# Copies your code file from your action repository to the filesystem path `/` of the container | ||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
# Code file to execute when the docker container starts up (`entrypoint.sh`) | ||
ENTRYPOINT ["/entrypoint.sh"] |
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,11 @@ | ||
# Grails pre-release action | ||
|
||
Performs some actions before doing a release | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: grails/grails-core/pre-release@master | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
``` |
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,12 @@ | ||
name: 'Grails pre-release action' | ||
description: 'Performs some actions before doing a release' | ||
inputs: | ||
token: | ||
description: 'GitHub token to authenticate the requests' | ||
required: true | ||
default: ${{ github.token }} | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.token }} |
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,43 @@ | ||
#!/bin/bash | ||
# $1 == GH_TOKEN | ||
|
||
echo -n "Determining release version: " | ||
release_version=${GITHUB_REF:11} | ||
echo $release_version | ||
|
||
if [ -n "$MICRONAUT_BUILD_EMAIL" ]; then | ||
GIT_USER_EMAIL=$MICRONAUT_BUILD_EMAIL | ||
fi | ||
|
||
if [ -z "$GIT_USER_NAME" ]; then | ||
GIT_USER_NAME="grails-build" | ||
fi | ||
|
||
echo "Configuring git" | ||
git config --global user.email "$GIT_USER_EMAIL" | ||
git config --global user.name "$GIT_USER_NAME" | ||
git config --global --add safe.directory /github/workspace | ||
git fetch | ||
|
||
echo -n "Determining target branch: " | ||
target_branch=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
echo $target_branch | ||
git checkout $target_branch | ||
|
||
echo "Setting release version in gradle.properties" | ||
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | ||
sed -i "s/assertEquals(\".*$/assertEquals(\"${release_version}\", GrailsUtil.getGrailsVersion());/" grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
sed -n "/assertEquals(\".*/p" grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
cat gradle.properties | ||
|
||
echo "Pushing release version and recreating v${release_version} tag" | ||
git add gradle.properties | ||
git add grails-core/src/test/groovy/grails/util/GrailsUtilTests.java | ||
git commit -m "[skip ci] Release v${release_version}" | ||
git tag -fa v${release_version} -m "Release v${release_version}" | ||
git push origin v${release_version} --force | ||
|
||
echo "Closing again the release after updating the tag" | ||
release_url=`cat $GITHUB_EVENT_PATH | jq '.release.url' | sed -e 's/^"\(.*\)"$/\1/g'` | ||
echo $release_url | ||
curl -s --request PATCH -H "Authorization: Bearer $1" -H "Content-Type: application/json" $release_url --data "{\"draft\": false}" |
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,45 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 0 | ||
target-branch: 3.3.x | ||
labels: | ||
- "type: dependency upgrade" | ||
- "relates-to: v3" | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 0 | ||
target-branch: 4.1.x | ||
labels: | ||
- "type: dependency upgrade" | ||
- "relates-to: v4" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: [ "version-update:semver-minor", "version-update:semver-major" ] | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
target-branch: 5.4.x | ||
labels: | ||
- "type: dependency upgrade" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 | ||
target-branch: 6.0.x | ||
labels: | ||
- "type: dependency upgrade" | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-patch", "version-update:semver-minor"] |
Oops, something went wrong.
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.
This file seems to be configured incorrectly. Also, I think we do not need to set-up dependabot updates.