Skip to content

Commit

Permalink
Try add windows build action
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Jan 28, 2023
1 parent c6ca9b7 commit dbe9564
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/windows-msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
tags:
- "v*.*.*"
branches:
- master
- main

jobs:
build:
runs-on: windows-2022
steps:
- name: Cache shards
uses: actions/cache@v2
with:
path: ~/.cache/shards
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }}
restore-keys: ${{ runner.os }}-shards-
- name: Download source
uses: actions/checkout@v2
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
- name: Install shards
run: shards check || shards install --without-development
- name: package information
run: |
echo "BINARY_NAME=myip" >> $GITHUB_ENV
echo "PKG_ARCH=x86_64" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: release binary
id: release
run: |
shards build --production --release --progress --no-debug --link-flags="-s -Wl,-z,relro,-z,now"
ASSERT_NAME=${BINARY_NAME}-${RELEASE_VERSION}-${PKG_ARCH}-unknown-linux-gnu.tar.gz
tar zcf ${ASSERT_NAME} bin/${BINARY_NAME} LICENSE
echo ::set-output name=ASSERT_NAME::${ASSERT_NAME}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.release.outputs.ASSERT_NAME }}

0 comments on commit dbe9564

Please sign in to comment.