Skip to content

Commit

Permalink
Update Build for release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yanecc committed May 1, 2024
1 parent f65a771 commit 361c9b5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/Build for release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,53 @@ jobs:
- name: Output artifact id
run: echo 'Artifact ID is ${{ steps.upload.outputs.artifact-id }}'

macOS-x86_64:
runs-on: macos-latest

steps:
- name: Download source
uses: actions/checkout@v4

- name: Install Crystal
uses: crystal-lang/[email protected]
with:
crystal: latest

- name: Build
run: |
crystal version
shards install
crystal spec --order=random
shards build --production --release --no-debug -Dpreview_mt
- name: Generate file name
id: get_name
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=$(date +'%Y%m%d')
fi
FILE_NAME="mockgpt-$VERSION-macos-x86_64"
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_OUTPUT
echo "Generated file name: $FILE_NAME"
- name: Collect assets
run: |
mv bin/mockgpt .
tar -cvzf ${{ steps.get_name.outputs.FILE_NAME }}.tgz mockgpt LICENSE README.md README_zh.md
- name: Upload artifact
uses: actions/upload-artifact@v4
id: upload
with:
name: ${{ steps.get_name.outputs.FILE_NAME }}
path: ${{ steps.get_name.outputs.FILE_NAME }}.tgz
retention-days: 7

- name: Output artifact id
run: echo 'Artifact ID is ${{ steps.upload.outputs.artifact-id }}'

Windows-static:
runs-on: windows-latest

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Crystal CI](https://github.com/yanecc/MockGPT/actions/workflows/Crystal%20CI.yml/badge.svg)](https://github.com/yanecc/MockGPT/actions/workflows/Crystal%20CI.yml)
[![Build for release](https://github.com/yanecc/MockGPT/actions/workflows/Build%20for%20release.yml/badge.svg)](https://github.com/yanecc/MockGPT/actions/workflows/Build%20for%20release.yml)

# Description

Expand Down
1 change: 1 addition & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Crystal CI](https://github.com/yanecc/MockGPT/actions/workflows/Crystal%20CI.yml/badge.svg)](https://github.com/yanecc/MockGPT/actions/workflows/Crystal%20CI.yml)
[![Build for release](https://github.com/yanecc/MockGPT/actions/workflows/Build%20for%20release.yml/badge.svg)](https://github.com/yanecc/MockGPT/actions/workflows/Build%20for%20release.yml)

# 项目说明

Expand Down

0 comments on commit 361c9b5

Please sign in to comment.