Skip to content

released v0.1.2 -> Added support for Korean Apple Stores @realJustinLee #19

released v0.1.2 -> Added support for Korean Apple Stores @realJustinLee

released v0.1.2 -> Added support for Korean Apple Stores @realJustinLee #19

Workflow file for this run

name: Build Release
on:
push:
branches:
- main
paths:
- "src/main/resources/release.json"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
# 从release.json 读取相关信息
- name: Read tag_main
id: tag_main
uses: ashley-taylor/[email protected]
with:
path: ./src/main/resources/release.json
property: tag_main
- name: Read tag_latest
id: tag_latest
uses: ashley-taylor/[email protected]
with:
path: ./src/main/resources/release.json
property: tag_latest
- name: Read description
id: description
uses: juliangruber/read-file-action@v1
with:
path: ./src/main/resources/release.info
trim: false
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Package with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
- name: ZIP files
run: |
mv -f ./target/apple-monitor-${{steps.tag_main.outputs.value}}.jar apple-monitor-v${{steps.tag_latest.outputs.value}}.jar
zip apple-monitor\ v${{steps.tag_latest.outputs.value}}.zip apple-monitor-v${{steps.tag_latest.outputs.value}}.jar
cp ./src/main/resources/config.json ./
zip apple-monitor\ v${{steps.tag_latest.outputs.value}}.zip config.json
zip apple-monitor\ v${{steps.tag_latest.outputs.value}}.zip README.md
zip apple-monitor\ v${{steps.tag_latest.outputs.value}}.zip -r docs/
# zip apple-monitor\ v${{steps.tag_latest.outputs.value}}.zip LICENSE
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{steps.tag_latest.outputs.value}}
release_name: apple-monitor-v${{steps.tag_latest.outputs.value}}
body: |
${{steps.description.outputs.content}}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./apple-monitor v${{steps.tag_latest.outputs.value}}.zip
asset_name: apple-monitor-v${{steps.tag_latest.outputs.value}}.zip
asset_content_type: application/zip