Skip to content

Commit b8eeb2c

Browse files
authored
Auto publish before JBang tests (#13779)
1 parent 75d2b47 commit b8eeb2c

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Publish to maven central
22

33
on:
4-
pull_request:
4+
# On releases
55
push:
6-
branches:
7-
- main
86
tags:
97
- '**'
10-
schedule:
11-
# Run on each Monday
12-
# Additional run in addition to the other events, because some resources could have changes
13-
- cron: '2 3 * * 1'
8+
9+
# Called by the JBang testing jobs to ensure that SNAPSHOT is uptodate
10+
workflow_call:
11+
secrets:
12+
KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64:
13+
required: true
14+
1415
workflow_dispatch:
1516
inputs:
1617
tagbuild:
@@ -19,6 +20,11 @@ on:
1920
default: false
2021
type: boolean
2122

23+
# Additional run in addition to the other events, because some resources could have changes
24+
schedule:
25+
# Run on each Monday
26+
- cron: '2 3 * * 1'
27+
2228
permissions:
2329
actions: write
2430
contents: read
@@ -56,7 +62,8 @@ jobs:
5662
github.event_name == 'schedule' ||
5763
github.event_name == 'workflow_dispatch' ||
5864
(needs.detect_changes.outputs.changed == 'true' &&
59-
((github.event_name == 'push' && github.repository == 'JabRef/jabref') ||
65+
((github.event_name == 'workflow_call' && github.repository == 'JabRef/jabref') ||
66+
(github.event_name == 'push' && github.repository == 'JabRef/jabref') ||
6067
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'JabRef/jabref'))
6168
)
6269
runs-on: ubuntu-latest

.github/workflows/tests-code.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ on:
88
pull_request:
99
merge_group:
1010
workflow_dispatch:
11-
# Re-run JBang tests after the SNAPSHOT is updated
12-
workflow_run:
13-
workflows: ["Publish to maven central"]
14-
types:
15-
- completed
11+
1612
env:
1713
AstrophysicsDataSystemAPIKey: ${{ secrets.AstrophysicsDataSystemAPIKey_FOR_TESTS }}
1814
BiodiversityHeritageApiKey: ${{ secrets.BiodiversityHeritageApiKey_FOR_TESTS}}
@@ -400,9 +396,16 @@ jobs:
400396
CI: "true"
401397
DBMS: "postgresql"
402398

399+
publish:
400+
if: github.ref == 'refs/heads/main'
401+
uses: ./.github/workflows/publish.yml
402+
secrets:
403+
KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64: ${{ secrets.KOPPOR_SIGNING_SECRETKEYRINGFILE_BASE64 }}
404+
403405
jbang:
404406
name: JBang (main)
405407
runs-on: ubuntu-latest
408+
needs: publish
406409
if: github.ref == 'refs/heads/main'
407410
steps:
408411
- name: Checkout source
@@ -438,6 +441,7 @@ jobs:
438441
jbang-pr:
439442
name: JBang (PR)
440443
runs-on: ubuntu-latest
444+
# does not need publish, because the JBang scripts are modified
441445
if: github.ref != 'refs/heads/main'
442446
strategy:
443447
fail-fast: false

0 commit comments

Comments
 (0)