From 545f32bcc3bc4722ca4321c6880736f50e1e7d3b Mon Sep 17 00:00:00 2001 From: "5684185+vsariola@users.noreply.github.com" <5684185+vsariola@users.noreply.github.com> Date: Sun, 24 Sep 2023 12:29:55 +0300 Subject: [PATCH] release v0.2.0 and add automated releases to CI --- .github/workflows/binaries.yml | 57 +++++++++++++++++++++++++++++++++- CHANGELOG.md | 5 +-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index ab5be99..1cc2ecb 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -5,13 +5,36 @@ on: branches: - master - dev + tags: + - 'v*' pull_request: branches: - master - dev jobs: + create_release: + name: Create release + runs-on: ubuntu-latest + # Note this. We are going to use that in further jobs. + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - uses: actions/checkout@v2 + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref_name }} + body_path: CHANGELOG.md + draft: false + prerelease: false + if: startsWith(github.ref, 'refs/tags/') binaries: + needs: create_release # we need to know the upload URL runs-on: ${{ matrix.config.os }} strategy: matrix: @@ -92,4 +115,36 @@ jobs: uses: actions/upload-artifact@v3 with: name: sointu-${{ runner.os }}-${{ steps.short-sha.outputs.sha }} - path: ${{ matrix.config.output }} \ No newline at end of file + path: ${{ matrix.config.output }} + upload_release_asset: + needs: [create_release, binaries] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + strategy: + matrix: + config: + - os: Windows + - os: Linux + - os: macOS + steps: + - uses: benjlevesque/short-sha@v2.2 + id: short-sha + with: + length: 7 + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: sointu-${{ matrix.config.os }}-${{ steps.short-sha.outputs.sha }} + path: sointu-${{ matrix.config.os }} + - name: Zip binaries + run: | + zip ./sointu-${{ matrix.config.os }}.zip sointu-${{ matrix.config.os }}/* + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + asset_name: sointu-${{ matrix.config.os }}.zip + asset_path: ./sointu-${{ matrix.config.os }}.zip + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 86db22e..d3da988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## v0.2.0 ### Added - Saving and loading instruments - Comment field to instruments @@ -69,5 +69,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - a command line utility to convert .yml songs to .asm - a command line utility to play the songs on command line -[Unreleased]: https://github.com/vsariola/sointu/compare/v0.1.0...HEAD +[Unreleased]: https://github.com/vsariola/sointu/compare/v0.2.0...HEAD +[0.2.0]: https://github.com/vsariola/sointu/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/vsariola/sointu/compare/4klang-3.11...v0.1.0 \ No newline at end of file