Merge pull request #4 from homebridge/nextVersion #6
Workflow file for this run
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
name: CI | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get the version (git tag) | |
id: get_version | |
run: | | |
echo ${GITHUB_REF/refs\/tags\//} | |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Build Image | |
run: | | |
docker build -t boot2homebridge . | |
docker run --rm boot2homebridge > homebridge-vm-image.iso | |
- name: Calculate Checksum | |
id: get_sha256_checksum | |
run: | | |
export IMAGE_SHA256_CHECKSUM=$(shasum -a 256 homebridge-vm-image.iso | awk '{print $1}') | |
echo "$IMAGE_SHA256_CHECKSUM homebridge-vm-image.iso" | |
echo ::set-output name=IMAGE_SHA256_CHECKSUM::${IMAGE_SHA256_CHECKSUM} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: | | |
Click the link below to start your download: | |
<span align="center"> | |
### [homebridge-vm-image.iso](https://github.com/homebridge/homebridge-vm-image/releases/download/${{ steps.get_version.outputs.VERSION }}/homebridge-vm-image.iso) | |
</span> | |
--- | |
* **SHA-256:** ${{ steps.get_sha256_checksum.outputs.IMAGE_SHA256_CHECKSUM }} | |
draft: false | |
prerelease: true | |
- name: Upload Image | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: homebridge-vm-image.iso | |
asset_name: homebridge-vm-image.iso | |
asset_content_type: application/x-iso9660-image |