feat(release): initial attempt at providing automatic builds

This commit is contained in:
2021-05-06 02:20:32 +01:00
parent 2054c8c0aa
commit 63289216d7
10 changed files with 811 additions and 6 deletions

53
.github/workflows/build-and-release.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
---
name: Build and Release
on:
workflow_dispatch:
inputs:
gitRef:
description: "Git Ref"
required: true
default: "master"
prerelease:
Description: "Pre-release?"
require: true
default: "true"
jobs:
build-and-release:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Generate plan.yml
run: >-
./build-emacs-for-macos --plan --plan-file=plan.yml
${{ github.event.inputs.gitRef }}
- name: Phow plan
run: cat plan.yml
- name: Check if release and asset already exist for given plan
id: check
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
go run ./cmd/github-release --plan plan.yml check
- name: Install dependencies
if: steps.check.outcome == 'failure'
run: >-
brew bundle
- name: Download and build Emacs
if: steps.check.outcome == 'failure'
run: >-
./build-emacs-for-macos --plan-file=plan.yml
- name: Publish release
if: steps.check.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
go run ./cmd/github-release --plan plan.yml publish
--prerelease=${{ github.event.inputs.prerelease }}