|
| 1 | +# This file was automatically generated by sbt-github-actions using the |
| 2 | +# githubWorkflowGenerate task. You should add and commit this file to |
| 3 | +# your git repository. It goes without saying that you shouldn't edit |
| 4 | +# this file by hand! Instead, if you wish to make changes, you should |
| 5 | +# change your sbt build configuration to revise the workflow description |
| 6 | +# to meet your needs, then regenerate this file. |
| 7 | + |
| 8 | +name: Continuous Integration |
| 9 | + |
| 10 | +on: |
| 11 | + pull_request: |
| 12 | + branches: ['**'] |
| 13 | + push: |
| 14 | + branches: ['**'] |
| 15 | + tags: [v*] |
| 16 | + |
| 17 | +env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + name: Build and Test |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + os: [ubuntu-latest] |
| 26 | + scala: [3.0.2] |
| 27 | + java: [zulu@1.8] |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + steps: |
| 30 | + - name: Checkout current branch (full) |
| 31 | + uses: actions/checkout@v2 |
| 32 | + with: |
| 33 | + fetch-depth: 0 |
| 34 | + |
| 35 | + - name: Setup Java and Scala |
| 36 | + uses: olafurpg/setup-scala@v13 |
| 37 | + with: |
| 38 | + java-version: ${{ matrix.java }} |
| 39 | + |
| 40 | + - name: Cache sbt |
| 41 | + uses: actions/cache@v2 |
| 42 | + with: |
| 43 | + path: | |
| 44 | + ~/.sbt |
| 45 | + ~/.ivy2/cache |
| 46 | + ~/.coursier/cache/v1 |
| 47 | + ~/.cache/coursier/v1 |
| 48 | + ~/AppData/Local/Coursier/Cache/v1 |
| 49 | + ~/Library/Caches/Coursier/v1 |
| 50 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 51 | + |
| 52 | + - name: Check that workflows are up to date |
| 53 | + run: sbt ++${{ matrix.scala }} githubWorkflowCheck |
| 54 | + |
| 55 | + - name: Build project |
| 56 | + run: sbt ++${{ matrix.scala }} test |
| 57 | + |
| 58 | + - name: Compress target directories |
| 59 | + run: tar cf targets.tar target project/target |
| 60 | + |
| 61 | + - name: Upload target directories |
| 62 | + uses: actions/upload-artifact@v2 |
| 63 | + with: |
| 64 | + name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} |
| 65 | + path: targets.tar |
| 66 | + |
| 67 | + publish: |
| 68 | + name: Publish Artifacts |
| 69 | + needs: [build] |
| 70 | + if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) |
| 71 | + strategy: |
| 72 | + matrix: |
| 73 | + os: [ubuntu-latest] |
| 74 | + scala: [3.0.2] |
| 75 | + java: [zulu@1.8] |
| 76 | + runs-on: ${{ matrix.os }} |
| 77 | + steps: |
| 78 | + - name: Checkout current branch (full) |
| 79 | + uses: actions/checkout@v2 |
| 80 | + with: |
| 81 | + fetch-depth: 0 |
| 82 | + |
| 83 | + - name: Setup Java and Scala |
| 84 | + uses: olafurpg/setup-scala@v13 |
| 85 | + with: |
| 86 | + java-version: ${{ matrix.java }} |
| 87 | + |
| 88 | + - name: Cache sbt |
| 89 | + uses: actions/cache@v2 |
| 90 | + with: |
| 91 | + path: | |
| 92 | + ~/.sbt |
| 93 | + ~/.ivy2/cache |
| 94 | + ~/.coursier/cache/v1 |
| 95 | + ~/.cache/coursier/v1 |
| 96 | + ~/AppData/Local/Coursier/Cache/v1 |
| 97 | + ~/Library/Caches/Coursier/v1 |
| 98 | + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 99 | + |
| 100 | + - name: Download target directories (3.0.2) |
| 101 | + uses: actions/download-artifact@v2 |
| 102 | + with: |
| 103 | + name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }} |
| 104 | + |
| 105 | + - name: Inflate target directories (3.0.2) |
| 106 | + run: | |
| 107 | + tar xf targets.tar |
| 108 | + rm targets.tar |
| 109 | +
|
| 110 | + - env: |
| 111 | + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} |
| 112 | + PGP_SECRET: ${{ secrets.PGP_SECRET }} |
| 113 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 114 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 115 | + run: sbt ++${{ matrix.scala }} ci-release |
0 commit comments