-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (85 loc) · 3.31 KB
/
patchright_release.yml
File metadata and controls
96 lines (85 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Patchright Java Release
on:
# schedule:
# # Check daily for new playwright-java releases
# - cron: '0 6 * * *'
workflow_dispatch:
inputs:
playwright_version:
description: 'Playwright Java version to patch (e.g., 1.52.0)'
required: false
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Check for new playwright-java release
id: check
run: |
if [ -n "${{ github.event.inputs.playwright_version }}" ]; then
VERSION="${{ github.event.inputs.playwright_version }}"
else
VERSION=$(curl -s https://api.github.com/repos/Kaliiiiiiiiii-Vinyzu/patchright/releases/latest | jq -r '.tag_name' | sed 's/^v//')
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Check if we already have this version released
EXISTING=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/tags/v${VERSION} | jq -r '.tag_name // empty')
if [ -z "$EXISTING" ]; then
echo "should_release=true" >> $GITHUB_OUTPUT
echo "New version to release: $VERSION"
else
echo "should_release=false" >> $GITHUB_OUTPUT
echo "Version $VERSION already released"
fi
build-and-release:
needs: check-release
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Build and Patch Sources
run: |
VERSION=${{ needs.check-release.outputs.version }}
bash scripts/build.sh "$VERSION" "cc.marbro.patchright" "true"
- name: Publish to GitHub Packages
run: |
cd patchright-java-release
mvn deploy -DskipTests -Dspotbugs.skip=true -Dcheckstyle.skip=true \
-DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check-release.outputs.version }}
name: Patchright Java v${{ needs.check-release.outputs.version }}
body: |
Patchright Java v${{ needs.check-release.outputs.version }}
Based on [playwright-java v${{ needs.check-release.outputs.version }}](https://github.com/microsoft/playwright-java/releases/tag/v${{ needs.check-release.outputs.version }})
## Installation (GitHub Packages)
Add to your `pom.xml`:
```xml
<dependency>
<groupId>cc.marbro.patchright</groupId>
<artifactId>patchright</artifactId>
<version>${{ needs.check-release.outputs.version }}</version>
</dependency>
```
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}