mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 14:16:00 +00:00
84 lines
2.2 KiB
YAML
84 lines
2.2 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
|
|
jobs:
|
|
prepare-release:
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone project
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build changelog
|
|
id: build_changelog
|
|
uses: mikepenz/release-changelog-builder-action@v1
|
|
with:
|
|
configuration: .github/changelog_conf.json
|
|
failOnError: true
|
|
ignorePreReleases: true
|
|
commitMode: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
body: ${{ steps.build_changelog.outputs.changelog }}
|
|
files: |
|
|
LICENSE
|
|
fail_on_unmatched_files: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build:
|
|
name: build-${{ matrix.os }}
|
|
if: always()
|
|
needs: prepare-release
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-20.04
|
|
asset_name: smp-server-ubuntu-20_04-x86-64
|
|
- os: ubuntu-18.04
|
|
asset_name: smp-server-ubuntu-18_04-x86-64
|
|
steps:
|
|
- name: Clone project
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Stack
|
|
uses: haskell/actions/setup@v1
|
|
with:
|
|
ghc-version: '8.8.4'
|
|
enable-stack: true
|
|
stack-version: 'latest'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.stack
|
|
key: ${{ matrix.os }}-${{ hashFiles('stack.yaml') }}
|
|
|
|
- name: Build & test
|
|
id: build_test
|
|
run: |
|
|
stack build --test
|
|
echo "::set-output name=LOCAL_INSTALL_ROOT::$(stack path --local-install-root)"
|
|
|
|
- name: Upload binaries to release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ${{ steps.build_test.outputs.LOCAL_INSTALL_ROOT }}/bin/smp-server
|
|
asset_name: ${{ matrix.asset_name }}
|
|
tag: ${{ github.ref }}
|