Skip to content

Commit

Permalink
修改打包脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Mar 12, 2021
1 parent 57c716e commit 1256a6c
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: package
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- '.gitignore'

env:
FILENAME: plugin-demo-java
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '8.0.181'
java-package: jdk
architecture: x64
- name: Set up Maven
uses: stCarolas/setup-maven@v3
with:
maven-version: 3.6.1
- name: Change Maven Settings
uses: whelk-io/maven-settings-xml-action@v12
with:
servers: '[{ "id": "github", "username": "${{ secrets.PRIVATE_GITHUB_REPO_USER }}", "password":"${{ secrets.PRIVATE_GITHUB_REPO_PASSWORD }}"}]'
- name: Build
run: mvn clean package
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.FILENAME }}.zip
# A file, directory or wildcard pattern that describes what to upload
path: ./target/${{ env.FILENAME }}.zip
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: release
on:
push:
tags:
- 'v*'

env:
FILENAME: plugin-demo-java
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '8.0.181'
java-package: jdk
architecture: x64
- name: Set up Maven
uses: stCarolas/setup-maven@v3
with:
maven-version: 3.6.1
- name: Change Maven Settings
uses: whelk-io/maven-settings-xml-action@v12
with:
servers: '[{ "id": "github", "username": "${{ secrets.PRIVATE_GITHUB_REPO_USER }}", "password":"${{ secrets.PRIVATE_GITHUB_REPO_PASSWORD }}"}]'
- name: Build
run: mvn clean package
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.FILENAME }}.zip
# A file, directory or wildcard pattern that describes what to upload
path: ./target/${{ env.FILENAME }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/${{ env.FILENAME }}.zip
asset_name: ${{ env.FILENAME }}.zip
asset_content_type: application/zip
6 changes: 3 additions & 3 deletions task.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"atomCode": "demo",
"atomCode": "plugin-demo-java",
"execution": {
"packagePath": "demo-jar-with-dependencies.jar",
"packagePath": "plugin-demo-java-jar-with-dependencies.jar",
"language": "java",
"minimumVersion": "1.8",
"demands": [],
"target": "$bk_java_path -jar demo-jar-with-dependencies.jar"
"target": "$bk_java_path -jar plugin-demo-java-jar-with-dependencies.jar"
},
"input": {
"desc": {
Expand Down

0 comments on commit 1256a6c

Please sign in to comment.