Merge pull request #234 from kevin-lee/bump-sbt #35
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" | |
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-${{ hashFiles('**/*.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-sbt | |
- name: sbt GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_AUTH_TOKEN_GITHUB }} | |
run: | | |
echo "Run] sbt GitHub release" | |
echo "mkdir -p dotty-docs" | |
mkdir -p dotty-docs | |
export SOURCE_DATE_EPOCH=$(date +%s) | |
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" | |
echo 'sbt -J-Xmx2048m devOopsGitHubRelease' | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
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-${{ hashFiles('**/*.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-sbt | |
- 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-Xmx2048m -v clean +test +packagedArtifacts ci-release devOopsGitHubReleaseUploadArtifacts' | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
-v \ | |
clean \ | |
+test \ | |
+packagedArtifacts \ | |
ci-release \ | |
devOopsGitHubReleaseUploadArtifacts | |
publish-snapshot: | |
if: startsWith(github.ref, 'refs/heads/') | |
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-${{ hashFiles('**/*.sbt') }} | |
restore-keys: | | |
${{ runner.os }}-sbt | |
- name: "sbt ci-release (no tag) - ${{ github.run_number }}" | |
if: startsWith(github.ref, 'refs/heads/') | |
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-Xmx2048m -v clean +test +packagedArtifacts ci-release devOopsGitHubReleaseUploadArtifacts' | |
sbt \ | |
-J-XX:MaxMetaspaceSize=1024m \ | |
-J-Xmx2048m \ | |
-v \ | |
clean \ | |
+test \ | |
+packagedArtifacts \ | |
ci-release |