-
Notifications
You must be signed in to change notification settings - Fork 17
86 lines (81 loc) · 2.93 KB
/
ant.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
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
name: Java CI
on:
push:
branches:
- master
- $default-branch
- $protected-branches
pull_request:
branches:
- master
- $default-branch
workflow_dispatch:
permissions:
id-token: write
attestations: write
contents: write
packages: write
jobs:
check-release-needed:
runs-on: ubuntu-latest
outputs:
release_needed: ${{ steps.create_release_needed.outputs.release_needed }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ (github.repository == 'JOSM/MapRoulette' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request') && '0' || '1' }}
- name: Set release needed
id: create_release_needed
run: |
last_tag=$(git describe --tags --abbrev=0 --always)
release_needed="false"
for file in $(git diff ${last_tag}..HEAD --name-only); do
if [[ $file = "src/main"* ]]; then
release_needed="true"
break
fi
done
echo "release_needed=$release_needed" >> $GITHUB_OUTPUT
call-workflow-latest:
needs: check-release-needed
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: ""
java-version: 17
call-workflow-min:
needs: check-release-needed
uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v3
with:
josm-revision: "r18877"
java-version: 17
perform-revision-tagging: ${{ github.repository == 'JOSM/Mapillary' && github.ref_type == 'branch' && github.ref_name == 'master' && github.event_name != 'schedule' && github.event_name != 'pull_request' }}
add-mapillary-keys:
runs-on: ubuntu-latest
needs: call-workflow-min
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Echo env
run: echo ${{ needs.call-workflow-min.outputs.tag }}
- name: Get Mapillary jar
run: gh release download ${{ needs.call-workflow-min.outputs.tag }} --pattern Mapillary.jar
- name: Add keys
run: |
cat <<EOF > mapillary_api_keys.json
{
"MAPILLARY_CLIENT_ID": "${{ secrets.MAPILLARY_CLIENT_ID }}",
"MAPILLARY_CLIENT_TOKEN": "${{ secrets.MAPILLARY_CLIENT_TOKEN }}",
"MAPILLARY_CLIENT_SECRET": "${{ secrets.MAPILLARY_CLIENT_SECRET }}"
}
EOF
zip Mapillary.jar mapillary_api_keys.json
- name: Perform attestation (jar after adding API keys)
uses: actions/attest-build-provenance@v1
with:
subject-path: Mapillary.jar
- name: Upload Mapillary jar
run: gh release upload ${{ needs.call-workflow-min.outputs.tag }} --clobber Mapillary.jar