Skip to content

Nightly Merge Mon 18 Nov 2024 10:52:07 GMT #70

Nightly Merge Mon 18 Nov 2024 10:52:07 GMT

Nightly Merge Mon 18 Nov 2024 10:52:07 GMT #70

name: Development Build/Release
on:
push:
branches:
- 'nightly'
env:
CI: false
OCD_VERSION: 0.1.0-alpha
RELEASE_TAG: v0.1.0-alpha.ocd.nightly
MAC_ARTEFACT: ocd-mac
WIN_ARTEFACT: ocd-win
RELEASE_ARTEFACTS_DIR: ./release-artefacts
BRANCH: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: -${{ github.head_ref || github.ref_name }}
jobs:
generate-variables:
runs-on: ubuntu-latest
outputs:
ocd_version: ${{ steps.version.outputs.ocd_version }}
okit_version: ${{ steps.version.outputs.okit_version }}
steps:
- uses: actions/checkout@v4
- id: version
run: |
echo "ocd_version=$(jq -r '.version' ocd/packages/desktop/package.json)" >> "$GITHUB_OUTPUT"
echo "okit_release_version=$(jq -r '.release' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
echo "okit_release_tag=$(jq -r '.tag' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
echo "okit_release_title=$(jq -r '.title' okitweb/static/okit/json/release.json)" >> "$GITHUB_OUTPUT"
update-or-create-release:
needs: [generate-variables]
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
# matrix:
# os: [macos-latest]
# version: [latest]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ needs.generate-variables.outputs.okit_release_tag }}
RELEASE_TITLE: ${{ needs.generate-variables.outputs.okit_release_title }}
OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}
# BRANCH_OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}-${{ github.head_ref || github.ref_name }}
BRANCH_RELEASE_TAG: ocd.${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Delete Release
id: delete_release
run: |
gh release delete ${{ env.BRANCH_RELEASE_TAG }} --yes --cleanup-tag
# - name: Update Release
# id: update_release
# run: |
# gh release edit ${{ env.BRANCH_RELEASE_TAG }} --title "OCD ${{ env.BRANCH }} Release ${{ env.OCD_VERSION }}" --notes-file ./ocd/README.md --target ${{ env.BRANCH }} --latest
- name: Create Release if Update fails
if: failure() || success()
id: create_release
run: |
gh release create ${{ env.BRANCH_RELEASE_TAG }} --title "OCD ${{ env.BRANCH }} Release ${{ env.OCD_VERSION }}" --notes-file ./ocd/README.md --target ${{ env.BRANCH }} --latest --prerelease
build-and-release:
needs: [update-or-create-release, generate-variables]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
version: [22.11.0]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG1: "electron-*"
RELEASE_TAG: ${{ needs.generate-variables.outputs.okit_release_tag }}
RELEASE_TITLE: ${{ needs.generate-variables.outputs.okit_release_title }}
OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}
# BRANCH_OCD_VERSION: ${{ needs.generate-variables.outputs.ocd_version }}-${{ github.head_ref || github.ref_name }}
BRANCH_RELEASE_TAG: ocd.${{ github.head_ref || github.ref_name }}
NODE_OPTIONS: "--max-old-space-size=8192"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- run: node --version
- run: npm --version
# - name: Install Snapcraft on Ubuntu
# if: startsWith(matrix.os, 'ubuntu')
# run: sudo snap install snapcraft --classic
- run: npm run github-action-install
- run: npm run github-action-compile-for-codegen
- run: npm run github-action-generate
- run: npm run github-action-build
# - run: npm run github-action-compile
# - run: npm run github-action-pack
# - run: npm run github-action-build-react
# - run: npm run github-action-build-electron
- name: Upload Mac Artifact to Release
if: matrix.os == 'macos-latest'
run: |
npm run github-action-build-macos-x86
ls -lashR ./ocd/dist
gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/make/ocd-${{ env.OCD_VERSION }}-*.dmg --clobber
- name: Upload Windows Artifact to Release
if: matrix.os == 'windows-latest'
run: |
ls ./ocd/dist
gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/win/ocd-${{ env.OCD_VERSION }}-x64.exe --clobber
- name: Upload Linux Artifact to Release
if: matrix.os == 'ubuntu-latest'
run: |
ls -lash ./ocd/dist
# gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/linux/ocd-${{ env.OCD_VERSION }}-*.rpm --clobber
# gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/linux/ocd-${{ env.OCD_VERSION }}-*.deb --clobber
gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/linux/ocd-${{ env.OCD_VERSION }}-*.snap --clobber
# gh release upload ${{ env.BRANCH_RELEASE_TAG }} ./ocd/dist/linux/ocd-${{ env.OCD_VERSION }}-*.AppImage --clobber