Skip to content

Commit

Permalink
Add more release related documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Ungar committed Jan 30, 2022
1 parent e758fbd commit 97d480a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@ on:
description: Version to release
required: true
jobs:
# Create new draft release on GitHub and upload zipped artifact
build-upload:
name: Build and Upload Plugin
environment: prod
runs-on: ubuntu-latest
steps:
# Checkout the current repository on master
- name: Checkout
uses: actions/checkout@v2.3.4
with:
ref: master

# Install the necessary Java environment
- name: Setup Java
uses: actions/setup-java@v1.4.3
with:
java-version: 11

# Build the plugin artifact
- name: Build Plugin
uses: eskatos/gradle-command-action@v1.3.3
with:
arguments: buildPlugin -Pversion=${{ github.event.inputs.version }}

# Create GitHub draft release
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -34,6 +42,8 @@ jobs:
release_name: Orion ${{ github.event.inputs.version }}
draft: true
prerelease: false

# Upload the plugin artifact as an asset to the draft release
- name: Upload GitHub Release Asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -43,23 +53,32 @@ jobs:
asset_path: ./build/distributions/orion-${{ github.event.inputs.version }}.zip
asset_name: orion-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip

# Publish new version to the JetBrains marketplace
jb-publish:
name: Upload Plugin to JetBrains
environment: prod
runs-on: ubuntu-latest
steps:
# Checkout the current repository on master
- name: Checkout
uses: actions/checkout@v2.3.4
with:
ref: master

# Install the necessary Java environment
- name: Setup Java
uses: actions/setup-java@v1.4.3
with:
java-version: 11

# Inject the plugin owner's credentials for the JetBrains repository into the build.gradle.kts
- name: Inject Mail
run: sed -i -e 's/<your_mail>/alexander.ungar@tum.de/g' build.gradle.kts
- name: Inject Token
run: sed -i -e 's/<your_token>/${{ secrets.PLUGIN_REPOSITORY_TOKEN }}/g' build.gradle.kts

# Build and upload the plugin to the JetBrains marketplace
- name: Publish Plugin
uses: eskatos/gradle-command-action@v1.3.3
with:
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,17 @@ The latest plugin artifact is now available on both GitHub and via the JetBrains
**It might take some time for the latest version to be seen on the marketplace since JetBrains still has to review
and approve the changes!**

### Release Process Implementation

**How can I modify the pipeline?**

The release pipeline is fully implemented using GitHub actions. In order to change anything about the process you just
have to edit the `release.yml` in the `.github/workflows` directory.

**Where can I find secrets like the authentication token for the JetBrains repository?**

Admins of the GitHub repository can modify the build environment under _Settings -> Environments -> prod_. This includes
adding and updating any secrets that should get injected into the environment during the build process.

## Feedback? Questions?
Email: alexander(dot)ungar(at)tum(dot)de

0 comments on commit 97d480a

Please sign in to comment.