Skip to content

Merge pull request #70 from jumpserver/dev #42

Merge pull request #70 from jumpserver/dev

Merge pull request #70 from jumpserver/dev #42

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release And Upload assets
jobs:
create-realese:
name: Create Release
runs-on: ubuntu-latest
strategy:
matrix:
java_version: [ '17' ]
node_version: [ '20' ]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.m2
~/.npm
~/.cache
key: ${{ runner.os }}-build-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-
- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
echo "TAG=$TAG" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-config.yml
version: ${{ steps.get_version.outputs.TAG }}
tag: ${{ steps.get_version.outputs.TAG }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: ${{ matrix.java_version }}
- name: Build web
run: |
cd frontend
yarn install
yarn build
- name: Build chen
run: |
mvn clean package -DskipTests
mkdir -p build chen-${{ steps.get_version.outputs.TAG }}
rm -f config/application-dev.yml
mv README.md chen-${{ steps.get_version.outputs.TAG }}/README.md
mv LICENSE chen-${{ steps.get_version.outputs.TAG }}/LICENSE
mv entrypoint.sh chen-${{ steps.get_version.outputs.TAG }}/entrypoint.sh
mv backend/web/target/web-*.jar chen-${{ steps.get_version.outputs.TAG }}/chen.jar
mv drivers chen-${{ steps.get_version.outputs.TAG }}/drivers
mv config chen-${{ steps.get_version.outputs.TAG }}/config
tar -zcvf chen-${{ steps.get_version.outputs.TAG }}.tar.gz chen-${{ steps.get_version.outputs.TAG }}
echo $(md5sum chen-${{ steps.get_version.outputs.TAG }}.tar.gz | awk '{print $1}') > build/chen-${{ steps.get_version.outputs.TAG }}.tar.gz.md5
mv chen-${{ steps.get_version.outputs.TAG }}.tar.gz build/
- name: Release Upload Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
build/*.gz
build/*.md5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}