Skip to content

5 release ci

5 release ci #54

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
style_check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: style_check_maven
- name: Check Format
run: ./mvnw editorconfig:check
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build_maven
- name: Build
run: |
ls -lh it/java8/src/test/java/online/sharedtype/it
./mvnw install -e
- name: Upload generated sources
uses: actions/upload-artifact@v4
with:
name: generated-sources
path: |
./it/java8/target/generated-sources
./it/java17/target/generated-sources
if-no-files-found: error
retention-days: 3
- name: Upload jars
uses: actions/upload-artifact@v4
with:
name: jars
path: |
~/.m2/repository/org/sharedtype
if-no-files-found: error
retention-days: 3
- name: Remove jars from cache
run: rm -rf ~/.m2/repository/org/sharedtype
jdk_compatibility_test:
needs: [build_and_test]
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- uses: actions/download-artifact@v4
with:
name: jars
path: ~/.m2/repository/org/sharedtype
# - name: Display downloaded artifact
# run: ls -lhR ~/.m2/repository/org/sharedtype
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build_maven
- name: Test
run: ./mvnw verify -pl it/java8 -e
client_test:
needs: [build_and_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/download-artifact@v4
with:
name: generated-sources
path: ./it/
# - name: Display downloaded artifact
# run: ls -lhR ./it/
- name: Test Typescript
working-directory: client-test/typescript
run: |
npm i
npm run test
# clean-artifact:
# needs: [ jdk_compatibility_test, client_test ]
# runs-on: ubuntu-latest
# if: always()
# steps:
# - uses: geekyeggo/delete-artifact@v5
# with:
# name: dist
release_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: release_maven
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Release
run: |
export MAVEN_GPG_PASSPHRASE='${{ secrets.MAVEN_GPG_PASSPHRASE }}'
./misc/release.sh
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.PR_APP_ID }}
private-key: ${{ secrets.PR_APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
branch: create-pull-request/bump_version
delete-branch: true