Skip to content

feat: add continue_flag to resume sessions in existing directories #36

feat: add continue_flag to resume sessions in existing directories

feat: add continue_flag to resume sessions in existing directories #36

Workflow file for this run

name: Release
on:
push:
branches: [main]
paths:
- shard.yml
permissions:
contents: write
env:
CRYSTAL_VERSION: 1.18.2
jobs:
check-version:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
- id: version
run: |
VERSION=$(grep '^version:' shard.yml | sed 's/version: *//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- id: check
run: |
if git ls-remote --tags origin | grep -q "refs/tags/v${{ steps.version.outputs.version }}$"; then
echo "should_release=false" >> $GITHUB_OUTPUT
else
echo "should_release=true" >> $GITHUB_OUTPUT
fi
build-linux:
needs: check-version
if: needs.check-version.outputs.should_release == 'true'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:1.18.2-alpine
steps:
- uses: actions/checkout@v6
- run: shards install --production
- run: |
shards build scry --production --release --static --no-debug
strip bin/scry
- run: tar -czvf scry-linux-x86_64.tar.gz -C bin scry
- uses: actions/upload-artifact@v6
with:
name: scry-linux-x86_64
path: scry-linux-x86_64.tar.gz
build-macos-arm:
needs: check-version
if: needs.check-version.outputs.should_release == 'true'
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ env.CRYSTAL_VERSION }}
- run: shards install --production
- run: |
shards build scry --production --release --no-debug
strip bin/scry
- run: tar -czvf scry-macos-arm64.tar.gz -C bin scry
- uses: actions/upload-artifact@v6
with:
name: scry-macos-arm64
path: scry-macos-arm64.tar.gz
release:
needs: [check-version, build-linux, build-macos-arm]
if: needs.check-version.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ needs.check-version.outputs.version }}" -m "Release v${{ needs.check-version.outputs.version }}"
git push origin "v${{ needs.check-version.outputs.version }}"
- uses: actions/download-artifact@v7
with:
path: dist
merge-multiple: true
- run: |
cd dist
sha256sum *.tar.gz > checksums.txt
- uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check-version.outputs.version }}
files: dist/*
generate_release_notes: true