This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.91 KB
/
test.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
name: Test and Release
on:
push:
branches:
- "**"
tags-ignore:
- "**"
schedule:
- cron: "0 0 1 * *" # Release once a month automatically
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew clean check
release:
needs: test
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create zip file
run: ./gradlew clean distZip
- name: Get current time
uses: srfrnk/current-time@master
id: current-time
with:
format: YYYYMMDD
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/distributions/apex-ast-serializer.zip"
token: ${{ secrets.PERSONAL_TOKEN }}
tag: "${{ steps.current-time.outputs.formattedTime }}-${{ github.run_number }}"
- name: Send event to prettier-plugin-apex
run: 'curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.PERSONAL_TOKEN }}" --request POST --data ''{"event_type": "jorje-update", "client_payload": { "release": "${{ steps.current-time.outputs.formattedTime }}-${{ github.run_number }}" }}'' https://api.github.com/repos/dangmai/prettier-plugin-apex/dispatches'