From efa12baa6e25be42554ac6ca55ca7b7baff41700 Mon Sep 17 00:00:00 2001 From: zrezke Date: Wed, 17 Jul 2024 12:01:35 +0200 Subject: [PATCH 1/3] latest --- .github/workflows/demo.workflow.yml | 60 +++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/demo.workflow.yml b/.github/workflows/demo.workflow.yml index 9e66e43a5..f4cafd9d2 100644 --- a/.github/workflows/demo.workflow.yml +++ b/.github/workflows/demo.workflow.yml @@ -45,7 +45,6 @@ jobs: path: launcher/windows/build/Output/ retention-days: 5 - release: if: startsWith(github.ref, 'refs/tags/v') runs-on: windows-latest @@ -57,17 +56,19 @@ jobs: name: 'installers' path: installers - # Sign Launcher + # Sign Launcher - name: Sign Windows Launcher run: | New-Item -ItemType directory -Path certificate Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WINDOWS_CERTIFICATE }}' certutil -decode certificate\certificate.txt certificate\certificate.pfx & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /td sha256 /fd sha256 /f certificate\certificate.pfx /p '${{ secrets.WINDOWS_CERTIFICATE_PASS }}' /tr http://timestamp.digicert.com installers/DepthAI_setup.exe + - name: Get current tag id: tag uses: battila7/get-version-action@v2 - # Create GitHub release + + # Create GitHub release - uses: actions/create-release@master id: createRelease name: Create ${{ steps.tag.outputs.version }} DepthAI Demo release @@ -95,3 +96,56 @@ jobs: asset_path: ${{ github.workspace }}\installers\DepthAI_setup.exe asset_name: DepthAI-setup-${{ steps.tag.outputs.version }}.exe asset_content_type: application/octet-stream + + latest-release: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: windows-latest + needs: windows-installer + steps: + - name: Download Windows installer + uses: actions/download-artifact@v2 + with: + name: 'installers' + path: installers + + # Create or update "latest" tag + - name: Create or update "latest" tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + latest_tag_sha=$(git rev-parse refs/tags/latest || echo "") + current_commit_sha=$(git rev-parse HEAD) + if [ "$latest_tag_sha" != "$current_commit_sha" ]; then + git tag -f latest + git push origin --tags --force + fi + + # Create or update "latest" release + - uses: actions/create-release@master + id: createLatestRelease + name: Create or update latest DepthAI Demo release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: latest + release_name: DepthAI Demo latest + body: | + ## Features + + ## Bugs + + ## Misc + + draft: false + prerelease: false + + # Upload release assets for "latest" + - name: Upload Windows Installer to Latest Release + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.createLatestRelease.outputs.upload_url }} + asset_path: ${{ github.workspace }}\installers\DepthAI_setup.exe + asset_name: DepthAI-setup-latest.exe + asset_content_type: application/octet-stream From 1291d2b9c911f73327b7acb34e4fcc75fefeae8e Mon Sep 17 00:00:00 2001 From: zrezke Date: Wed, 17 Jul 2024 12:13:17 +0200 Subject: [PATCH 2/3] maybe fix --- .github/workflows/demo.workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/demo.workflow.yml b/.github/workflows/demo.workflow.yml index f4cafd9d2..8e7c754f9 100644 --- a/.github/workflows/demo.workflow.yml +++ b/.github/workflows/demo.workflow.yml @@ -108,7 +108,7 @@ jobs: name: 'installers' path: installers - # Create or update "latest" tag + # Use Bash shell to create or update "latest" tag - name: Create or update "latest" tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -119,6 +119,7 @@ jobs: git tag -f latest git push origin --tags --force fi + shell: bash # Create or update "latest" release - uses: actions/create-release@master From e85690d9738c8998c1f22e2ab31537497839dd36 Mon Sep 17 00:00:00 2001 From: zrezke Date: Wed, 17 Jul 2024 12:32:40 +0200 Subject: [PATCH 3/3] checkout --- .github/workflows/demo.workflow.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/demo.workflow.yml b/.github/workflows/demo.workflow.yml index 8e7c754f9..afecb1675 100644 --- a/.github/workflows/demo.workflow.yml +++ b/.github/workflows/demo.workflow.yml @@ -16,8 +16,6 @@ jobs: windows-installer: runs-on: windows-latest steps: - # Clones repository without persisting credentials - # As this local git repository is packed with installer - uses: actions/checkout@v2 with: submodules: 'recursive' @@ -102,6 +100,9 @@ jobs: runs-on: windows-latest needs: windows-installer steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Download Windows installer uses: actions/download-artifact@v2 with: