Skip to content

Commit

Permalink
Fix ci (#6)
Browse files Browse the repository at this point in the history
* try to fix realease upload
* merge assembly and release, next try
* unique id
* restructure ci and merged assembly and release
* uncommented test and
publish
  • Loading branch information
ake2l authored Feb 4, 2021
1 parent 606d553 commit 0f15199
Showing 1 changed file with 31 additions and 51 deletions.
82 changes: 31 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- '**'
- '**'
create:
tags:
- '*'
Expand Down Expand Up @@ -109,47 +109,7 @@ jobs:
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}

###################### Assembly and Deploy ######################

assembly_jdk11:
runs-on: ubuntu-latest
needs:
- test_jdk11
- build_jdk11
if: startsWith(github.ref, 'refs/tags/')
container: maven:3.6-adoptopenjdk-11
steps:
- uses: actions/checkout@v2
- name: Download dot.env
uses: actions/download-artifact@v2
with:
name: setup
- run: bash dot.env
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Download build_jdk11 for assembly
uses: actions/download-artifact@v2
with:
name: build_jdk11
path: target
- run: mvn versions:set -DnewVersion=$ARTIFACT_VERSION
- name: check content of target
run: cd target && ls
- run: mvn $MAVEN_CLI_OPTS site:site assembly:single -Dmaven.test.skip=true
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: assembly_jdk11
path: |
target/*.tar.gz
target/*.zip
target/site/
if-no-files-found: error
retention-days: 5
###################### Deploy ######################

publish_jdk11:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -186,41 +146,51 @@ jobs:

###################### Release ######################

releasepreparation:
release_jdk11:
runs-on: ubuntu-latest
container: maven:3.6-adoptopenjdk-11
needs:
- assembly_jdk11
- test_jdk11
- build_jdk11
if: startsWith(github.ref, 'refs/tags/')
container: maven:3.6-adoptopenjdk-11
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Download dot.env
uses: actions/download-artifact@v2
with:
name: setup
- run: bash dot.env
- name: Download assembly_jdk11 for release
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Download build_jdk11 for assembly
uses: actions/download-artifact@v2
with:
name: build_jdk11
path: target
- run: mvn versions:set -DnewVersion=$ARTIFACT_VERSION
- name: check content of target
run: cd target && ls
- run: mvn $MAVEN_CLI_OPTS site:site assembly:single -Dmaven.test.skip=true
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: Release ${GITHUB_REF/refs\/tags\//}
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
- name: Upload zip Release Asset
id: upload-release-asset-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -229,3 +199,13 @@ jobs:
asset_path: target/${{ env.ARTIFACT_FULLNAME }}-dist.zip
asset_name: ${{ env.ARTIFACT_FULLNAME }}-dist.zip
asset_content_type: application/zip
- name: Upload tar.gz Release Asset
id: upload-release-asset-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/${{ env.ARTIFACT_FULLNAME }}-dist.tar.gz
asset_name: ${{ env.ARTIFACT_FULLNAME }}-dist.tar.gz
asset_content_type: application/zip

0 comments on commit 0f15199

Please sign in to comment.