-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Patrick Conway edited this page Jun 28, 2017
·
3 revisions
To run as a build step in Jenkins (or anything similar):
#!/bin/bash wget -L "https://github.com/blackducksoftware/github-auto-release/releases/download/1.0.0/github_auto_release.sh" chmod 777 github_auto_release.sh ./github_auto_release.sh
You have four types of choices to select artifacts to release.
- No artifacts
- If you wouldn't like any files to be attached to your release, add the following parameters when you call this script: -n false
- Specific File Path
- If you know the exact name of the file you would like to attach to the release, you can specify it with the flag -f fileName.
- Directory and Artifact Type
- You may specify a file extension to look
- If you only provide a file extension (like .jar), then the script will look for a file that follows the naming convention of repo_name-release_version.fileExtension
- You may provide a regex prior to the file extension to attempt to match a file. This is useful if your artifacts follow a convention like repo-name-release-version.fileExtension as you could specify repo-name-*.fileExtension to find any file that contains repo-name and any release version.
- Default
- If you don't specify any of the previous parameters, the script will look for files following this convention by default: repo-name-release-version.zip OR repo-name-release-version.tar. If neither is found, no files will be attached, and script will end benignly.
If at anytime a parameters are passed to find a file and more than one file is found, the script will error out. This is to prevent attachment of incorrect files.
-
Required:
- -b|--buildTool
- specify build tool (maven or gradle for now)
- -o|--owner
- name of the owner under which the repo is located
- -b|--buildTool
-
Optional
- -f|--artifactFile
- specify file path to project's artifact file (if build artifact is not standard, user can specify to make sure it is released) CANNOT SPECIFY BOTH A DIRECTORY AND FILE
- -n|--attachArtifacts
- choice to override attaching binaries. If set to false, script will only tag non-SNAPSHOT versions.
- -m|--releaseDesc
- add description for release to Github
- -h|--help
- help menu
- -f|--artifactFile
-
Conditionally Optional
- -p|--project
- IF using a NuGet project, you must provide a project name
- -t|--artifactType
- if specified, artifactDirectory must also be specified - if file artifact file type is not .zip or .tar specify a file type here and the script will look for a file in workspace that follows the convention of REPO_NAME-RELEASE_VERSION with specified ending. You may define as .jar to look for file with name repo_name-release_version.jar, or define regex.jar to find a jar file that matches given regex (ex. *.jar matches any .jar file)
- -d|--artifactDirectory
- if specified, artifactType must also be specified - specify a directory to be zipped and released CANNOT SPECIFY BOTH A DIRECTORY AND FILE
- note that if there are more multiple directories with subdirectories of the same name, then you must specify assembly/target, or similar
- define file paths as follows sub1/sub2/sub3 ...
- -p|--project
-
Overrides
- -ev|--executableVersion
- which version of the GitHub-Release executable to be used (default is v0.7.2 because that is the version this script is being tested with)
- -ep|--executablePath
- where on the user's machine the GitHub-Release executable will live (default is set to ~/temp/GARTool)
- -ev|--executableVersion