Merge pull request #221 from nocalhost/dev-tian-add-241-support #97
Workflow file for this run
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
name: release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
create-release: | |
name: create plugin release | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
outputs: | |
gh_release_upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create plugin Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
release-plugin: | |
name: build | |
runs-on: ubuntu-latest | |
needs: create-release | |
strategy: | |
matrix: | |
platform-version: [ 233, 241 ] | |
env: | |
ORG_GRADLE_PROJECT_platformVersion: ${{ matrix.platform-version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Java JDK | |
uses: actions/setup-java@v1.4.3 | |
with: | |
java-version: 17 | |
- name: Get tag | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
echo "PLUGIN_VERSION=${GITHUB_REF#refs/*/}" | sed -E 's/v//g' >> $GITHUB_ENV | |
echo "NHCTL_VERSION=${GITHUB_REF#refs/*/}" | sed 's/v//g' >> $GITHUB_ENV | |
echo "SERVER_VERSION=${{ secrets.MINIMUNM_VERSION_REQUIREMENT }}" | sed 's/v//g' >> $GITHUB_ENV | |
- name: Build | |
env: | |
JETBRAINS_TOKEN: ${{ secrets.JETBRAINS_TOKEN }} | |
run: | | |
sed -i "s/sentryDsn=/sentryDsn=${{secrets.INTELLIJ_PLUGIN_SENTRY_DSN}}/g" src/main/resources/config.properties | |
sed -i -E "s/nhctlVersion=(.+)/nhctlVersion=${{ env.NHCTL_VERSION }}/g" src/main/resources/config.properties | |
sed -i -E "s/serverVersion=(.+)/serverVersion=${{ env.SERVER_VERSION }}/g" src/main/resources/config.properties | |
sed -i -E "s/version=(.+)/version=${{ env.PLUGIN_VERSION }}/g" gradle.properties | |
./gradlew clean publishPlugin | |
- name: Rename package | |
run: | | |
PLUGIN_ZIP=$(ls build/distributions | grep nocalhost-intellij-plugin-) | |
cp build/distributions/${PLUGIN_ZIP} build/distributions/nocalhost-intellij-plugin.zip | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create-release.outputs.gh_release_upload_url }} | |
asset_path: build/distributions/nocalhost-intellij-plugin.zip | |
asset_name: nocalhost-intellij-plugin-${{ env.RELEASE_VERSION }}-${{ matrix.platform-version }}.zip | |
asset_content_type: application/octet-stream | |
- name: Push to Coding Artifacts | |
run: | | |
curl -T build/distributions/nocalhost-intellij-plugin.zip -u ${{ secrets.CODING_ARTIFACTS_USER }}:${{ secrets.CODING_ARTIFACTS_PASS }} "https://nocalhost-generic.pkg.coding.net/nocalhost/plugins/nocalhost-intellij-plugin.zip?version=${{ env.RELEASE_VERSION }}-${{ matrix.platform-version }}" |