Skip to content

Commit

Permalink
ci: Only publish if tests pass (#86)
Browse files Browse the repository at this point in the history
* ci: Only publish if tests pass

* Cosmetics
  • Loading branch information
arl committed Feb 18, 2023
1 parent 2f7b93a commit 4decaa8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/cd.yml → .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: Continuous Deployment

on:
push:
tags:
- "*"

permissions:
contents: write

on: [push, pull_request]
name: Test, Build and Publish
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20.x"
- name: Run tests
run: go test -race ./...

goreleaser:
name: Publish release to github/brew
name: Build and Publish
needs: tests
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,15 +38,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

check_brew:
name: Check brew tap has been updated
runs-on: macos-latest
name: Check Brew Tap
needs: goreleaser
runs-on: macos-latest
steps:
- name: brew tap/install
- name: Install gitmux with brew
run: |
brew tap arl/arl
brew install gitmux
gitmux -V
- name: check gitmux version
- name: Check installed gitmux version
run: |
[ v$(gitmux -V) == "$GITHUB_REF_NAME" ]
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml

This file was deleted.

0 comments on commit 4decaa8

Please sign in to comment.