Skip to content

Commit

Permalink
Merge pull request #38 from gerlero/ci
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero authored Jun 28, 2022
2 parents 35f7031 + 3d8d898 commit 5499884
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 30 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
branches:
- main
workflow_call:
inputs:
app-version:
type: string
required: true

jobs:
build:
runs-on: macos-latest
steps:
- name: Get version number
id: get_version
uses: battila7/get-version-action@v2
- name: Checkout
uses: actions/checkout@v2
- name: Cache DMG file
Expand All @@ -33,12 +33,12 @@ jobs:
touch build/*.dmg
- name: Build
run: |
make zip APP_VERSION=${{ steps.get_version.outputs.version-without-v }}
make zip APP_VERSION=${{ inputs.app-version }}
- name: Upload ZIP artifact
uses: actions/upload-artifact@v3
with:
name: zip-${{ runner.arch }}
path: build/*.zip
name: zip
path: build/*-app-*.zip
if-no-files-found: error

test:
Expand All @@ -54,31 +54,13 @@ jobs:
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip-${{ runner.arch }}
name: zip
path: build
- name: Unzip app
run: |
unzip *.zip
unzip *-app-$(uname -m).zip
working-directory: build
- name: Test
run: |
make install-dependencies
make test
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest
steps:
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip-${{ runner.arch }}
- name: Upload ZIP to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
file_glob: true
overwrite: true
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version-without-v }}
steps:
- name: Get version number
id: get_version
uses: battila7/get-version-action@v2

build:
needs: get-version
uses: ./.github/workflows/ci.yml
with:
app-version: needs.get-version.outputs.version

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download ZIP artifact
uses: actions/download-artifact@v3
with:
name: zip
- name: Upload ZIP to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
file_glob: true
overwrite: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Native OpenFOAM v2112 as a Mac app**, with binaries compiled from the [OpenFOAM source code](https://develop.openfoam.com/Development/openfoam/-/blob/master/doc/Build.md). Intel and Apple silicon variants.

[![CI](https://github.com/gerlero/openfoam2112-app/actions/workflows/ci.yml/badge.svg)](https://github.com/gerlero/openfoam2112-app/actions/workflows/ci.yml) [![homebrew cask](https://img.shields.io/badge/homebrew%20cask-gerlero%2Fopenfoam%2Fopenfoam2112-informational)](https://github.com/gerlero/homebrew-openfoam) ![GitHub all releases](https://img.shields.io/github/downloads/gerlero/openfoam2112-app/total)
[![CI](https://github.com/gerlero/openfoam2112-app/actions/workflows/ci.yml/badge.svg)](https://github.com/gerlero/openfoam2112-app/actions/workflows/ci.yml) [![Release](https://github.com/gerlero/openfoam2112-app/actions/workflows/release.yml/badge.svg)](https://github.com/gerlero/openfoam2112-app/actions/workflows/release.yml) [![homebrew cask](https://img.shields.io/badge/homebrew%20cask-gerlero%2Fopenfoam%2Fopenfoam2112-informational)](https://github.com/gerlero/homebrew-openfoam) ![GitHub all releases](https://img.shields.io/github/downloads/gerlero/openfoam2112-app/total)

## ⬇️ Install

Expand Down

0 comments on commit 5499884

Please sign in to comment.