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

Simplify release process by generating artifacts in the CI #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [created]

jobs:
build:
Expand All @@ -22,5 +24,28 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package

- name: Get release upload URL
id: get_release_upload_url
if: github.event_name == 'release'
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Extract version string
id: version_string_variable
run: echo "VERSION_STRING=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: Upload release asset
id: upload-release-asset
if: github.event_name == 'release'
uses: shogo82148/[email protected]
with:
upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
asset_path: ./target/openrefine-commons.zip
asset_name: openrefine-commons-${{ env.VERSION_STRING }}.zip
asset_content_type: application/zip

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ To avoid having to unzip the extension in the corresponding directory every time
- Commit and push those changes to master
- Add a corresponding git tag, with `git tag -a v0.1.0 -m "Version 0.1.0"` (when working from GitHub Desktop, you can follow [this process](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-commits/managing-tags) and manually add the `v0.1.0` tag with the description `Version 0.1.0`)
- Push the tag to GitHub: `git push --tags` (in GitHub Desktop, just push again)
- Create the zip file for the release: `mvn package`
- Create a new release on GitHub at https://github.com/OpenRefine/CommonsExtension/releases/new, providing a release title (such as "Commons extension 0.1.0") and a description of the features in this release. Upload the zip file you generated at the previous step as an attachment (it can be found in the `target` subfolder of your local copy of the repository).
- Create a new release on GitHub at https://github.com/OpenRefine/CommonsExtension/releases/new, providing a release title (such as "Commons extension 0.1.0") and a description of the features in this release.
- Open `pom.xml` and set the version to the expected next version number, followed by `-SNAPSHOT`. For instance, if you just released 0.1.0, you could set `<version>0.1.1-SNAPSHOT</version>`
- Commit and push those changes.
Loading