Skip to content

Create Release on Successful Builds #15

Create Release on Successful Builds

Create Release on Successful Builds #15

Workflow file for this run

name: Create Release on Successful Builds
on:
workflow_run:
workflows: ["Run Build Lint and test Next.js app", "Run Build and test Tauri App"]
types:
- completed
push:
tags:
- "v*"
permissions:
contents: write
jobs:
bootstrap:
runs-on: ubuntu-latest
steps:
- name: Initialize Release Workflow
run: echo "Bootstrap job to satisfy GitHub's dependency rules."
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# needs: ["Run Build Lint and test Next.js app", "Run Build and test Tauri App"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Next.js Build Artifact
uses: actions/download-artifact@v4
with:
name: nextjs-build-success
- name: Download Tauri Build Artifact
uses: actions/download-artifact@v4
with:
name: tauri-build-success
# - name: Create GitHub Release
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ github.sha }}
# release_name: "Release ${{ github.sha }}"
# body: "Automated release for commit ${{ github.sha }}."
# draft: false
# prerelease: false
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${tag#v}" \
--generate-notes
- name: Upload Tauri Binaries (for Windows, macOS, Linux)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./tauri-app/target/release/bundle/*.app
asset_name: TauriApp-${{ github.sha }}.zip
asset_content_type: application/zip