diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d74fb89..8c8c6c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,3 +3,40 @@ on: [push, pull_request, workflow_dispatch] jobs: build: uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Get the latest commit message + id: get_commit + run: echo "::set-output name=message::$(git log -1 --pretty=%B)" + + - name: Download firmware artifact + uses: actions/download-artifact@v3 + with: + name: firmware + path: ./firmware + + - name: Create GitHub Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.sha }} + release_name: ${{ steps.get_commit.outputs.message }} + body: | + Release created for commit ${{ github.sha }}. + draft: false + prerelease: false + + - name: Upload Firmware to Release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./firmware + asset_name: firmware.zip + asset_content_type: application/zip