122 lines
5.1 KiB
YAML
122 lines
5.1 KiB
YAML
name: Tauri Builder - Tag
|
|
|
|
on:
|
|
push:
|
|
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
|
|
|
|
jobs:
|
|
# Job create Update app version based on latest release tag with build number and save to output
|
|
get-update-version:
|
|
uses: ./.github/workflows/template-get-update-version.yml
|
|
|
|
create-draft-release:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
outputs:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
version: ${{ steps.get_version.outputs.version }}
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Extract tag name without v prefix
|
|
id: get_version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
|
|
env:
|
|
GITHUB_REF: ${{ github.ref }}
|
|
- name: Create Draft Release
|
|
id: create_release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
name: "${{ env.VERSION }}"
|
|
draft: true
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
|
|
build-macos:
|
|
uses: ./.github/workflows/template-tauri-build-macos.yml
|
|
secrets: inherit
|
|
needs: [get-update-version, create-draft-release]
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
public_provider: github
|
|
channel: stable
|
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
|
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
|
|
|
|
build-windows-x64:
|
|
uses: ./.github/workflows/template-tauri-build-windows-x64.yml
|
|
secrets: inherit
|
|
needs: [get-update-version, create-draft-release]
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
public_provider: github
|
|
channel: stable
|
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
|
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
|
|
|
|
build-linux-x64:
|
|
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
|
|
secrets: inherit
|
|
needs: [get-update-version, create-draft-release]
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
public_provider: github
|
|
channel: stable
|
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
|
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
|
|
|
|
sync-temp-to-latest:
|
|
needs: [create-draft-release, get-update-version, build-macos, build-windows-x64, build-linux-x64]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: create latest.json file
|
|
run: |
|
|
|
|
VERSION=${{ needs.get-update-version.outputs.new_version }}
|
|
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
|
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
|
|
LINUX_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
|
|
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
|
|
WINDOWS_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
|
|
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
|
|
DARWIN_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-macos.outputs.TAR_NAME }}"
|
|
|
|
jq --arg version "$VERSION" \
|
|
--arg pub_date "$PUB_DATE" \
|
|
--arg linux_signature "$LINUX_SIGNATURE" \
|
|
--arg linux_url "$LINUX_URL" \
|
|
--arg windows_signature "$WINDOWS_SIGNATURE" \
|
|
--arg windows_url "$WINDOWS_URL" \
|
|
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
|
|
--arg darwin_arm_url "$DARWIN_URL" \
|
|
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
|
|
--arg darwin_amd_url "$DARWIN_URL" \
|
|
'.version = $version
|
|
| .pub_date = $pub_date
|
|
| .platforms["linux-x86_64"].signature = $linux_signature
|
|
| .platforms["linux-x86_64"].url = $linux_url
|
|
| .platforms["windows-x86_64"].signature = $windows_signature
|
|
| .platforms["windows-x86_64"].url = $windows_url
|
|
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
|
|
| .platforms["darwin-aarch64"].url = $darwin_arm_url
|
|
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
|
|
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
|
|
src-tauri/latest.json.template > latest.json
|
|
cat latest.json
|
|
|
|
- name: Upload release assert if public provider is github
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
with:
|
|
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
|
|
asset_path: ./latest.json
|
|
asset_name: latest.json
|
|
asset_content_type: text/json |