0.1.0 #1
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: | |
release: | |
types: [ published ] | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
steps: | |
# Assume that input tag is formatted like 'v1.2.3' and transforms that to '1.2.3' | |
- name: Normalize version | |
id: normalize-version | |
uses: actions/github-script@v5 | |
with: | |
result-encoding: string | |
script: | | |
const tagName = context.payload.release.tag_name; | |
if (tagName.startsWith("v")) { | |
const version = tagName.substring(1); | |
console.log(`Setting version to ${version}`); | |
core.setOutput('version', version); | |
} else { | |
core.setFailed(`Release tag ${tagName} does not have a prefix 'v'`); | |
} | |
outputs: | |
version: ${{ steps.normalize-version.outputs.version }} | |
# TODO: duplication from build.yaml | |
build: | |
needs: [ prepare ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
opensearchVersion: ['2.5.0'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build -DbaseVersion=${{ needs.prepare.outputs.version }} -DopensearchVersion=${{ matrix.opensearchVersion }} | |
- name: Upload the artifacts | |
uses: skx/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
args: 'build/distributions/*.zip' |