99
1010jobs :
1111
12- build :
12+ test :
1313 runs-on : ubuntu-latest
14- if : github.event.head_commit.author.name != 'actions'
1514 steps :
1615 - uses : actions/checkout@v2
17- 18- with :
19- node-version : ' 16'
16+ - uses : actions/setup-node@v2
2017 - uses : bahmutov/npm-install@v1
2118 - run : yarn build
2219 - run : npx keycloakify
2320 env :
2421 XDG_CACHE_HOME : " /home/runner/.cache/yarn"
25- - uses : actions/upload-artifact@v2
26- with :
27- name : standalone_keycloak_theme
28- path : build_keycloak/target/*keycloak-theme*.jar
29- - uses : actions/upload-artifact@v2
30- with :
31- name : build
32- path : build
3322
3423 check_if_version_upgraded :
3524 name : Check if version upgrade
25+ if : github.event_name == 'push'
3626 runs-on : ubuntu-latest
37- needs : build
27+ needs : test
3828 outputs :
3929 from_version : ${{ steps.step1.outputs.from_version }}
4030 to_version : ${{ steps.step1.outputs.to_version }}
@@ -44,34 +34,33 @@ jobs:
4434 id : step1
4535 with :
4636 action_name : is_package_json_version_upgraded
37+ branch : ${{ github.head_ref || github.ref }}
4738
4839 create_github_release :
4940 runs-on : ubuntu-latest
50- needs :
51- - check_if_version_upgraded
41+ needs : check_if_version_upgraded
5242 # We create a release only if the version have been upgraded and we are on a default branch
53- # PR on the default branch can release beta but not real release
54- if : |
55- needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' &&
56- (
57- github.event_name == 'push' ||
58- needs.check_if_version_upgraded.outputs.is_release_beta == 'true'
59- )
43+ if : needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' && github.event_name == 'push'
6044 steps :
61- - run : mkdir jars
62- - uses : actions/download-artifact@v2
63- with :
64- name : standalone_keycloak_theme
65- - run : mv *keycloak-theme*.jar jars/keycloak-theme-dsfr.jar
45+ - uses : actions/checkout@v2
46+ - uses : actions/setup-node@v2
47+ - uses : bahmutov/npm-install@v1
48+ - run : yarn build
49+ - run : npx keycloakify
50+ env :
51+ XDG_CACHE_HOME : " /home/runner/.cache/yarn"
52+ - run : mv build_keycloak/target/retrocompat-*.jar retrocompat-keycloak-theme.jar
53+ - run : mv build_keycloak/target/*.jar keycloak-theme.jar
6654 - uses : softprops/action-gh-release@v1
6755 with :
6856 name : Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
6957 tag_name : v${{ needs.check_if_version_upgraded.outputs.to_version }}
7058 target_commitish : ${{ github.head_ref || github.ref }}
7159 generate_release_notes : true
72- files : |
73- jars/keycloak-theme-dsfr.jar
7460 draft : false
75- prerelease : ${{ needs.check_if_version_upgraded.outputs.is_release_beta == 'true' }}
61+ files : |
62+ retrocompat-keycloak-theme.jar
63+ keycloak-theme.jar
7664 env :
7765 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66+
0 commit comments