Skip to content

Commit

Permalink
Merge pull request #868 from InseeFr/ci/push-jar-on-release
Browse files Browse the repository at this point in the history
ci: build release & push artifact
  • Loading branch information
laurentC35 authored Jan 18, 2024
2 parents ad5078b + 179cdac commit 8c2e01a
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,56 +73,57 @@ jobs:

- uses: actions/checkout@v4
- name: Build Eno modules
run: ./gradlew build
run: |
./gradlew build
mv ./eno-ws/build/libs/*.jar ./eno-ws/build/libs/eno-ws.jar
- name: Upload Eno-WS jar
uses: actions/upload-artifact@v4
with:
name: eno-ws-jar
path: ./eno-ws/build/libs/*.jar
path: ./eno-ws/build/libs/eno-ws.jar

create-tag:
create-release: # replaced with create-tag while v3 is not the main branch
needs: [ check-version, build-sources ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ needs.check-version.outputs.release-version }}

# create-release: # replaced with create-tag while v3 is not the main branch
# needs: [ check-version, build-sources ]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ github.ref }}
# fetch-depth: 0
#
# - name: Get previous final release tag
# id: previousTag
# run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | tail -1)" >> $GITHUB_OUTPUT
#
# - name: Create release note
# id: changelog
# uses: requarks/changelog-action@v1
# with:
# fromTag: ${{ github.sha }}
# toTag: ${{ steps.previousTag.outputs.previousTag}}
# token: ${{ secrets.GITHUB_TOKEN }}
# writeToFile: false
#
# - uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ needs.check-version.outputs.release-version }}
# target_commitish: ${{ github.head_ref || github.ref }}
# name: ${{ needs.check-version.outputs.release-version }}
# body: ${{steps.changelog.outputs.changes}}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
fetch-depth: 0

- name: Get previous final release tag
id: previousTag
run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$" | tail -1)" >> $GITHUB_OUTPUT

- name: Create release note
id: changelog
uses: requarks/changelog-action@v1
with:
fromTag: ${{ github.sha }}
toTag: ${{ steps.previousTag.outputs.previousTag}}
token: ${{ secrets.GITHUB_TOKEN }}
writeToFile: false

- name: Download build
id: download
uses: actions/download-artifact@v4
with:
name: eno-ws-jar
path: eno-ws/build/libs/

- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.check-version.outputs.release-version }}
target_commitish: ${{ github.head_ref || github.ref }}
name: ${{ needs.check-version.outputs.release-version }}
body: ${{steps.changelog.outputs.changes}}
files: eno-ws/build/libs/eno-ws.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-docker:
needs: [ check-version, create-tag ]
needs: [ check-version, create-release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit 8c2e01a

Please sign in to comment.