.github/workflows/create_release.yml #80
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 with Maven | ||
run: | | ||
mvn clean package -P agent -P package -DskipTests | ||
# cd ${{ github.workspace }}/scripts | ||
# javac -cp "$env:JAVA_HOME\lib\tools.jar" AgentLoader.java -encoding utf-8 | ||
# cp AgentLoader.class ${{ github.workspace }}/sermant-agent-${{ env.version }} | ||
# cd .. | ||
# mvn clean 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 |