Merge branch 'fix_use_global_options' #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- "v*.*.*" | |
branches: | |
- master | |
schedule: | |
- cron: "15 3 * * 1" # Every monday at 3:15 AM | |
jobs: | |
call-ci: | |
uses: ./.github/workflows/ci.yml | |
secrets: inherit | |
build: | |
needs: call-ci | |
runs-on: ubuntu-latest | |
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@v4 | |
- 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=bin/procodile" >> $GITHUB_ENV | |
echo "PKG_ARCH=x86_64" >> $GITHUB_ENV | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
echo "PLATFORM=unknown-linux-gnu.tar.gz" >> $GITHUB_ENV | |
echo "BUILD_ARGS=--link-flags=\"-s -Wl,-z,relro,-z,now\"" >> $GITHUB_ENV | |
- name: set asset name | |
run: | | |
echo "ASSERT_NAME=${{env.BINARY_NAME}}-${{env.RELEASE_VERSION}}-${{env.PKG_ARCH}}-${{env.PLATFORM}}" >> $GITHUB_ENV | |
- name: release binary | |
id: release | |
run: | | |
echo "ASSERT_NAME=${{env.ASSERT_NAME}}" >> $GITHUB_OUTPUT | |
shards build --production --release --progress --no-debug -Dstrict_multi_assign -Dno_number_autocast ${{env.BUILD_ARGS}} | |
tar zcvf ${{env.ASSERT_NAME}} ${{env.BINARY_NAME}} LICENSE | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{steps.release.outputs.ASSERT_NAME}} |