Merge pull request #342 from kevin-lee/prepare-to-release #28
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: | |
# branches: | |
# - main | |
tags: | |
- '*' | |
env: | |
GH_JAVA_VERSION: "adopt@1.11" | |
CLI_SCALA_VERSION: "3.2.2" | |
CLI_SCALA_BINARY_VERSION: "3" | |
GRAALVM_JAVA_VERSION: "adopt@1.11" | |
GRAALVM_BIN_DIR_NAME: "native-image" | |
PROJECT_NAME: "maven2sbt" | |
jobs: | |
gh-release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.3.4 | |
- uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: ${{ env.GH_JAVA_VERSION }} | |
- name: Cache SBT | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.ivy2/cache | |
~/.cache/coursier | |
~/.sbt | |
key: ${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | |
restore-keys: | | |
${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}- | |
- name: sbt GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
run: | | |
echo "Run] sbt GitHub release" | |
echo 'sbt -J-XX:MaxMetaspaceSize=1024m -J-Xmx2048m devOopsGitHubRelease' | |
sbt \ | |
-J-Xmx2048m \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
devOopsGitHubRelease | |
publish: | |
needs: gh-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.3.4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: ${{ env.GH_JAVA_VERSION }} | |
- uses: olafurpg/setup-gpg@v3 | |
- name: Cache SBT | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.ivy2/cache | |
~/.cache/coursier | |
~/.sbt | |
key: ${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | |
restore-keys: | | |
${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}- | |
- name: "sbt ci-release - ${{ github.run_number }}" | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
run: | | |
echo "Run] sbt ci-release" | |
export SOURCE_DATE_EPOCH=$(date +%s) | |
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" | |
echo 'sbt -J-XX:MaxMetaspaceSize=1024m -J-Xmx2048m -v clean +test +packagedArtifacts ci-release devOopsGitHubReleaseUploadArtifacts' | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
-v \ | |
clean \ | |
+test \ | |
+packagedArtifacts \ | |
ci-release | |
packager-gh-release: | |
needs: gh-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.3.4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: ${{ env.GH_JAVA_VERSION }} | |
- name: Cache SBT | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.ivy2/cache | |
~/.cache/coursier | |
~/.sbt | |
key: ${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | |
restore-keys: | | |
${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}- | |
- name: "sbt GitHub Release and Publish tag for ${{ matrix.scala.name }} ${{ matrix.scala.version }} - ${{ github.run_number }}" | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
run: | | |
echo "Run] sbt ci-release" | |
export SOURCE_DATE_EPOCH=$(date +%s) | |
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" | |
echo 'sbt -J-XX:MaxMetaspaceSize=1024m -J-Xmx2048m ++${{ env.CLI_SCALA_VERSION }}! -v clean test universal:packageBin devOopsGitHubReleaseUploadArtifacts' | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
++${{ env.CLI_SCALA_VERSION }}! \ | |
-v \ | |
clean \ | |
test \ | |
universal:packageBin \ | |
devOopsGitHubReleaseUploadArtifacts | |
graalvm-gh-release: | |
needs: gh-release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
run-binary: [maven2sbt-cli] | |
steps: | |
- uses: actions/checkout@v2.3.4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: ${{ env.GRAALVM_JAVA_VERSION }} | |
- name: Cache SBT | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.ivy2/cache | |
~/.cache/coursier | |
~/.sbt | |
key: ${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | |
restore-keys: | | |
${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}- | |
- name: "GraalVM Build for Scala ${{ env.CLI_SCALA_VERSION }} - ${{ github.run_number }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
CURRENT_BRANCH_NAME: ${{ github.ref }} | |
RUN_ID: ${{ github.run_id }} | |
RUN_NUMBER: ${{ github.run_number }} | |
run: | | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
++${{ env.CLI_SCALA_VERSION }}! \ | |
clean \ | |
test \ | |
nativeImage | |
rm -f modules/${{ env.PROJECT_NAME }}-*/target/scala-*/*.jar | |
ls -lGh modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/ | |
sh -c "modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }} --help" | |
mv modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }} modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }}-${{ matrix.os }} | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
devOopsGitHubReleaseUploadArtifacts | |
graalvm-win-gh-release: | |
needs: gh-release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
run-binary: [maven2sbt-cli] | |
run-binary-ext: [exe] | |
steps: | |
- name: Configure git | |
run: "git config --global core.autocrlf false" | |
shell: bash | |
- uses: actions/checkout@v2.3.4 | |
with: | |
fetch-depth: 0 | |
- uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: ${{ env.GRAALVM_JAVA_VERSION }} | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- name: Cache SBT | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.ivy2/cache | |
~/.cache/coursier | |
~/.sbt | |
key: ${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/build.properties') }} | |
restore-keys: | | |
${{ runner.os }}-sbt-${{ env.CLI_SCALA_BINARY_VERSION }}- | |
- name: "GraalVM Build for Scala ${{ env.CLI_SCALA_VERSION }} - ${{ github.run_number }}" | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
CURRENT_BRANCH_NAME: ${{ github.ref }} | |
RUN_ID: ${{ github.run_id }} | |
RUN_NUMBER: ${{ github.run_number }} | |
run: | | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
++${{ env.CLI_SCALA_VERSION }}! \ | |
clean \ | |
test \ | |
nativeImage | |
rm -f modules/${{ env.PROJECT_NAME }}-*/target/scala-*/*.jar | |
ls -lGh modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/ | |
sh -c "modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }} --help" | |
mv modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }}.${{ matrix.run-binary-ext }} modules/${{ env.PROJECT_NAME }}-cli/target/${{ env.GRAALVM_BIN_DIR_NAME }}/${{ matrix.run-binary }}-${{ matrix.os }}.${{ matrix.run-binary-ext }} | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
devOopsGitHubReleaseUploadArtifacts | |