Skip to content

Commit

Permalink
ci: qbot release test
Browse files Browse the repository at this point in the history
  • Loading branch information
Charmve committed Oct 8, 2023
1 parent 818d17a commit 5576cd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
draft: true
prerelease: true
tag_name: ${{ github.ref }}
# tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -47,9 +47,11 @@ jobs:
needs: release
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.8]
environment: qbot_release
env:
tag_name: ${{ github.ref }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand Down Expand Up @@ -93,13 +95,13 @@ jobs:
npm run build
cd $GITHUB_WORKSPACE/investool
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool_app_mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/axiaoxin-com/investool/version.Version=`TZ=Asia/Shanghai date +'%y%m%d%H%M'`" -o investool_app_${{ matrix.os }}
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '' 's/env = "localhost"/env = "prod"/' config.toml
else
sed -i "s/env = \"localhost\"/env = \"prod\"/g" config.toml
fi
tar czvf investool_app_mac.tar.gz investool_app_mac config.toml
tar czvf investool_app_${{ matrix.os }}.tar.gz investool_app_${{ matrix.os }} config.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -110,13 +112,13 @@ jobs:
mv $GITHUB_WORKSPACE/pyfunds/fund-strategies/dist/* package/fund-strategies
mv $GITHUB_WORKSPACE/investool/* package/investool
mv ./dist/* package/
tar -zcvf qbot_release_mac_v1.tar.gz ./package
tar -zcvf qbot_release_${{ matrix. os }}_${tag_name}.tar.gz ./package
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: release_on_${{ matrix. os }}
path: qbot_release_mac_v1.tar.gz
path: qbot_release_${{ matrix.os }}_${tag_name}.tar.gz
retention-days: 7

- name: Create Release
Expand All @@ -125,8 +127,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.0.0
release_name: Release v1.0.0
# tag_name: v1.0.0
release_name: Qbot Release v1.0.0
draft: true
prerelease: true

Expand All @@ -137,6 +139,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: qbot_release_mac_v1.tar.gz
asset_name: qbot_release_mac_v1.tar.gz
asset_path: qbot_release_${{ matrix.os }}_${tag_name}.tar.gz
asset_name: qbot_release_${{ matrix.os }}_${tag_name}.tar.gz
asset_content_type: application/gzip
4 changes: 2 additions & 2 deletions .github/workflows/qbot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest]
python-version: [3.8]
environment: npm
environment: fund_strategy
steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: release_on_${{ matrix. os }}
name: release_on_${{ matrix.os }}
path: dist/
retention-days: 5

Expand Down

0 comments on commit 5576cd7

Please sign in to comment.