release script - 12 #85
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- 'v*' | |
name: Create Release | |
env: | |
tag: ${{ github.ref }} | |
jobs: | |
auto-create-release: | |
name: Auto Create Release | |
runs-on: windows-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 "$env:JAVA_HOME\lib\tools.jar" AgentLoader.java -encoding utf-8 | |
javac -cp "$env:JAVA_HOME\lib\tools.jar" AgentLoaderEn.java -encoding utf-8 | |
javac AesUtil.java -encoding utf-8 | |
choco install msys2 -y | |
echo "C:\tools\msys64\usr\bin" >> $GITHUB_PATH | |
gcc --version | |
gcc attach.c -o attach | |
New-Item -Path "${{ github.workspace }}/sermant-agent-${{ env.version }}/tools" -ItemType Directory | |
cp AgentLoader.class ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools | |
cp AgentLoaderEn.class ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools | |
cp AesUtil.class ${{ github.workspace }}/sermant-agent-${{ env.version }}/tools | |
cp attach.c ${{ 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 |