-
Notifications
You must be signed in to change notification settings - Fork 12
58 lines (56 loc) · 2.04 KB
/
deploy.yml
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
name: Deploy
on:
push:
tags: ["*"]
jobs:
deploy:
name: Deploy package
runs-on: ubuntu-latest
permissions:
contents: write
environment:
name: maven-central
url: https://central.sonatype.com/artifact/io.github.tree-sitter/jtreesitter
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 22
cache: maven
server-id: central
server-username: SONATYPE_USERNAME
server-password: SONATYPE_TOKEN
gpg-private-key: ${{secrets.GPG_KEY}}
- name: Get tree-sitter commit
run: printf 'TREE_SITTER_REF=%s\n' "$(git rev-parse HEAD:core)" >> "$GITHUB_ENV"
- name: Set up tree-sitter
uses: tree-sitter/setup-action/lib@v2
with:
tree-sitter-ref: ${{env.TREE_SITTER_REF}}
- name: Set up tree-sitter-java
run: |-
git clone --depth=1 https://github.com/tree-sitter/tree-sitter-java
make -Ctree-sitter-java all install PREFIX="$RUNNER_TOOL_CACHE/tree-sitter/lib"
- name: Set up jextract
run: |-
curl -LSs '${{env.JEXTRACT_URL}}' | tar xzf - -C "$RUNNER_TOOL_CACHE"
printf '%s/jextract-22/bin\n' "$RUNNER_TOOL_CACHE" >> "$GITHUB_PATH"
env:
# NOTE: keep this in sync with ci, docs
JEXTRACT_URL: https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
- name: Deploy to Maven Central
run: mvn --no-transfer-progress deploy -Dspotbugs.skip=true
env:
SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}}
SONATYPE_TOKEN: ${{secrets.SONATYPE_TOKEN}}
MAVEN_GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}
- name: Create release
run: gh release create $GITHUB_REF_NAME --generate-notes
env:
GH_TOKEN: ${{github.token}}
GH_REPO: ${{github.repository}}