devops: publish Maven package to GitHub packages (#99)

This commit is contained in:
Yury Semikhatsky 2020-12-08 16:04:18 -08:00 committed by GitHub
parent 32a5d91a29
commit 4b2042205e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,33 @@
name: Publish Maven package to GitHub
on:
push:
branches: [ master ]
jobs:
build:
timeout-minutes: 30
strategy:
fail-fast: false
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Install driver
shell: bash
run: scripts/download_driver.sh
- name: Build with Maven
run: mvn -B package -D skipTests --no-transfer-progress
- name: Publish to GitHub Packages
run: mvn -B deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -76,4 +76,12 @@
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/microsoft/playwright-java</url>
</repository>
</distributionManagement>
</project>