Skip to content

Commit

Permalink
CI: add release drafting on tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
GPMueller committed Mar 26, 2021
1 parent 7d978bc commit 476b4ae
Showing 1 changed file with 81 additions and 1 deletion.
82 changes: 81 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,84 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: webapp
CLEAN: true
CLEAN: true

draft-release:
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
needs: [desktop-app, web-app]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: 🎉 Create draft release
id: draft_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true

- uses: actions/download-artifact@master
id: download_artifacts

- name: 📦 Pack macOS and web zips
shell: bash
run: |
ls -R
pwd
echo ${{ github.event.ref }}
echo ${{ github.event.release.tag_name }}
tag_name=${{ github.event.release.tag_name }}
pattern=${{ steps.download_artifacts.outputs.download-path }}/imgui-app-ubuntu/*.zip
files=($pattern)
echo "ubuntu_zip=${files[0]}" >> $GITHUB_ENV
echo "pattern=$pattern"
echo "files=$files"
echo "ubuntu_zip=${{ env.ubuntu_zip }}"
pattern=${{ steps.download_artifacts.outputs.download-path }}/imgui-app-windows/*.zip
files=($pattern)
echo "windows_zip=${files[0]}" >> $GITHUB_ENV
echo "pattern=$pattern"
echo "files=$files"
echo "windows_zip=${{ env.windows_zip }}"
echo "GH Env: $GITHUB_ENV"
version_tag=${tag_name#refs/*/}
echo "version_tag=$version_tag" >> $GITHUB_ENV
echo "Release version $version_tag"
cd ${{ steps.download_artifacts.outputs.download-path }}/imgui-app-macos
zip -r ${{runner.workspace}}/macos-app.zip *
cd ${{ steps.download_artifacts.outputs.download-path }}/imgui-app-web
zip -r ${{runner.workspace}}/web-app.zip *
- name: 🚀 Release Linux desktop app
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ${{ env.ubuntu_zip }}
asset_name: desktop-app-${{ env.version_tag }}-linux.zip
asset_content_type: application/zip

- name: 🚀 Release macOS desktop app
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ${{runner.workspace}}/macos-app.zip
asset_name: desktop-app-${{ env.version_tag }}-macos.zip
asset_content_type: application/zip

- name: 🚀 Release Windows desktop app
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ${{ env.windows_zip }}
asset_name: desktop-app-${{ env.version_tag }}-windows.zip
asset_content_type: application/zip

- name: 🚀 Release web app
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.draft_release.outputs.upload_url }}
asset_path: ${{runner.workspace}}/web-app.zip
asset_name: web-app-${{ env.version_tag }}.zip
asset_content_type: application/zip

0 comments on commit 476b4ae

Please sign in to comment.