Skip to content

Release 0.7.8

Release 0.7.8 #25

Workflow file for this run

name: CD
on:
release:
types:
- published
jobs:
build:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
steps:
- name: Install Crystal
uses: oprypin/install-crystal@v1
with:
crystal: 1.3.2
- name: Additional Linux dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libyaml-dev
- name: Additional macOS dependencies
if: contains(matrix.os, 'macos')
run: |
brew install openssl yq
- name: Get runner environment
id: runner
uses: msansoni/runner-environment-action@v1
- name: Checkout code
uses: actions/checkout@v2
- name: Update version
run: |
yq eval -i ".version = \"${{ github.event.release.tag_name }}\"" shard.yml
perl -pi -e 's/VERSION = ".*"/VERSION = "${{ github.event.release.tag_name }}"/g' src/werk.cr
- name: Install dependencies
run: shards install --production --ignore-crystal-version
- name: Build
if: contains(matrix.os, 'macos')
run: shards build --release --no-debug
- name: Build static
if: contains(matrix.os, 'ubuntu')
run: shards build --release --no-debug --static
- name: Upload application
id: upload
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bin/werk
asset_name: werk-${{ steps.runner.outputs.platform }}-${{steps.runner.outputs.arch}}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Homebrew formula update
uses: mislav/bump-homebrew-formula-action@v1.12
if: "contains(matrix.os, 'macos') && !github.event.release.prerelease"
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
with:
formula-name: werk
homebrew-tap: marghidanu/homebrew-werk
base-branch: master
docker:
runs-on: ubuntu-latest
if: "!github.event.release.prerelease"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update version
run: |
yq eval -i ".version = \"${{ github.event.release.tag_name }}\"" shard.yml
perl -pi -e 's/VERSION = ".*"/VERSION = "${{ github.event.release.tag_name }}"/g' src/werk.cr
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64
tags: boord/werk:${{ github.event.release.tag_name }},boord/werk:latest
cache-from: type=registry,ref=boord/werk:latest
cache-to: type=inline