Skip to content

release script

release script #87

Workflow file for this run

on:
push:
tags:
- 'v*'
name: Create Release
env:
tag: ${{ github.ref }}
jobs:
auto-create-release:
name: Auto Create Release
runs-on: ubuntu-latest
steps:
- name: save env version
shell: bash
run: |
str=${{env.tag}}
echo "version=${str##*v}" >> $GITHUB_ENV
- name: Checkout Source
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Create License Binary Suffix
run: |
mvn license:aggregate-add-third-party
- name: set version
run: |
mvn versions:set -DnewVersion='${{ env.version }}'
- name: Build agent with Maven
run: |
mvn clean package -P agent -DskipTests
- name: compile tools
run: |
cd ${{ github.workspace }}/scripts
javac -cp ./:$JAVA_HOME/lib/tools.jar AgentLoader.java
javac AesUtil.java
gcc attach_sermant_agent.c -o attach_sermant_agent
mkdir ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools
cp AgentLoader.class ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools
cp AesUtil.class ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools
cp attach_sermant_agent ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools
cp readme.txt ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools
- name: package sermant
run: |
mvn package -P package -DskipTests
mkdir ${{ github.workspace }}/package
cp ${{ github.workspace }}/sermant-agent-*.tar.gz ${{ github.workspace }}/package/sermant-${{ env.version }}.tar.gz
ls ${{ github.workspace }}/package
- name: Create Release # automatically release new version
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/package/sermant-${{ env.version }}.tar.gz
asset_name: sermant-${{ env.version }}.tar.gz
asset_content_type: application/tar