|  | 
| 12 | 12 |  branches: ['**'] | 
| 13 | 13 |  push: | 
| 14 | 14 |  branches: ['**'] | 
|  | 15 | + tags: [v*] | 
| 15 | 16 | 
 | 
| 16 | 17 | env: | 
| 17 | 18 |  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
|  | 19 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | 
|  | 20 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | 
|  | 21 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} | 
| 18 | 22 | 
 | 
| 19 | 23 | jobs: | 
| 20 | 24 |  build: | 
|  | 
| 63 | 67 |  run: sbt ++${{ matrix.scala }} githubWorkflowCheck | 
| 64 | 68 | 
 | 
| 65 | 69 |  - run: sbt ++${{ matrix.scala }} '${{ matrix.ci }}' | 
|  | 70 | + | 
|  | 71 | + - name: Compress target directories | 
|  | 72 | + run: tar cf targets.tar target root/target core/target webworker/target project/target | 
|  | 73 | + | 
|  | 74 | + - name: Upload target directories | 
|  | 75 | + uses: actions/upload-artifact@v2 | 
|  | 76 | + with: | 
|  | 77 | + name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} | 
|  | 78 | + path: targets.tar | 
|  | 79 | + | 
|  | 80 | + publish: | 
|  | 81 | + name: Publish Artifacts | 
|  | 82 | + needs: [build] | 
|  | 83 | + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) | 
|  | 84 | + strategy: | 
|  | 85 | + matrix: | 
|  | 86 | + os: [ubuntu-latest] | 
|  | 87 | + scala: [3.0.1] | 
|  | 88 | + java: [adopt@1.8] | 
|  | 89 | + runs-on: ${{ matrix.os }} | 
|  | 90 | + steps: | 
|  | 91 | + - name: Checkout current branch (full) | 
|  | 92 | + uses: actions/checkout@v2 | 
|  | 93 | + with: | 
|  | 94 | + fetch-depth: 0 | 
|  | 95 | + | 
|  | 96 | + - name: Setup Java and Scala | 
|  | 97 | + uses: olafurpg/setup-scala@v13 | 
|  | 98 | + with: | 
|  | 99 | + java-version: ${{ matrix.java }} | 
|  | 100 | + | 
|  | 101 | + - name: Cache sbt | 
|  | 102 | + uses: actions/cache@v2 | 
|  | 103 | + with: | 
|  | 104 | + path: | | 
|  | 105 | + ~/.sbt | 
|  | 106 | + ~/.ivy2/cache | 
|  | 107 | + ~/.coursier/cache/v1 | 
|  | 108 | + ~/.cache/coursier/v1 | 
|  | 109 | + ~/AppData/Local/Coursier/Cache/v1 | 
|  | 110 | + ~/Library/Caches/Coursier/v1 | 
|  | 111 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | 
|  | 112 | + | 
|  | 113 | + - name: Download target directories (2.12.14) | 
|  | 114 | + uses: actions/download-artifact@v2 | 
|  | 115 | + with: | 
|  | 116 | + name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} | 
|  | 117 | + | 
|  | 118 | + - name: Inflate target directories (2.12.14) | 
|  | 119 | + run: | | 
|  | 120 | + tar xf targets.tar | 
|  | 121 | + rm targets.tar | 
|  | 122 | +
 | 
|  | 123 | + - name: Download target directories (2.13.6) | 
|  | 124 | + uses: actions/download-artifact@v2 | 
|  | 125 | + with: | 
|  | 126 | + name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} | 
|  | 127 | + | 
|  | 128 | + - name: Inflate target directories (2.13.6) | 
|  | 129 | + run: | | 
|  | 130 | + tar xf targets.tar | 
|  | 131 | + rm targets.tar | 
|  | 132 | +
 | 
|  | 133 | + - name: Download target directories (3.0.1) | 
|  | 134 | + uses: actions/download-artifact@v2 | 
|  | 135 | + with: | 
|  | 136 | + name: target-${{ matrix.os }}-3.0.1-${{ matrix.java }} | 
|  | 137 | + | 
|  | 138 | + - name: Inflate target directories (3.0.1) | 
|  | 139 | + run: | | 
|  | 140 | + tar xf targets.tar | 
|  | 141 | + rm targets.tar | 
|  | 142 | +
 | 
|  | 143 | + - name: Import signing key | 
|  | 144 | + run: echo $PGP_SECRET | base64 -d | gpg --import | 
|  | 145 | + | 
|  | 146 | + - name: Hack pinentry to use PGP_PASSPHRASE | 
|  | 147 | + env: | 
|  | 148 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | 
|  | 149 | + run: echo "$PGP_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 build.sbt &> /dev/null | 
|  | 150 | + | 
|  | 151 | + - run: sbt ++${{ matrix.scala }} release | 
0 commit comments