diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fd3474ac..8df8e0c7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,47 +9,8 @@ on: 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 + runs-on: ubuntu-20.04 steps: - name: Clone project uses: actions/checkout@v2 @@ -65,19 +26,38 @@ jobs: uses: actions/cache@v2 with: path: ~/.stack - key: ${{ matrix.os }}-${{ hashFiles('stack.yaml') }} + key: ${{ hashFiles('stack.yaml') }} - name: Build & test id: build_test run: | stack build --test --force-dirty - echo "::set-output name=LOCAL_INSTALL_ROOT::$(stack path --local-install-root)" - - - name: Upload binaries to release + install_root=$(stack path --local-install-root) + mv ${install_root}/bin/smp-server smp-server-ubuntu-20_04-x86-64 + + - name: Build changelog if: startsWith(github.ref, 'refs/tags/v') - uses: svenstaro/upload-release-action@v2 + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v1 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 }} + configuration: .github/changelog_conf.json + failOnError: true + ignorePreReleases: true + commitMode: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + body: | + See full changelog [here](https://github.com/simplex-chat/simplexmq/blob/master/CHANGELOG.md). + Commits, chronological: + ${{ steps.build_changelog.outputs.changelog }} + files: | + LICENSE + smp-server-ubuntu-20_04-x86-64 + fail_on_unmatched_files: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}