diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9afb60f..46d3cf4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,3 +49,44 @@ jobs: with: name: macoOS.zip path: smrepl_darwin_amd64 + + release: + runs-on: ubuntu-latest + needs: [build] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - id: release + uses: release-drafter/release-drafter@v5 + + - uses: actions/download-artifact@v2 + + - run: | + VER="${{ github.ref }}" + echo "VERSION=${VER#refs/tags/v}" >> $GITHUB_ENV + + - name: Upload Linux + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release.outputs.upload_url }} + asset_path: ./linux.zip + asset_name: linux.zip + asset_content_type: application/zip + + - name: Upload Windows + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release.outputs.upload_url }} + asset_path: ./windows.zip + asset_name: windows.zip + asset_content_type: application/zip + + - name: Upload MacOS + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.release.outputs.upload_url }} + asset_path: ./macOS.zip + asset_name: macOS.zip + asset_content_type: application/zip