on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' name: ci-tag jobs: # Pre-job to find the latest tag get-latest-tag: runs-on: ubuntu-latest timeout-minutes: 2 outputs: latest-tag: ${{ steps.latest-tag.outputs.tag }} steps: # Ignore preview or RC tags when searching for the latest - name: Find latest tag id: latest-tag continue-on-error: true uses: OpenShock/actions/find-latest-tag@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1 with: regex: '^[0-9]+\.[0-9]+\.[0-9]+$' - name: Set output run: echo "latest-tag=${{ steps.latest-tag.outputs.tag }}" # Pre-job to find the latest RC tag get-latest-rc-tag: runs-on: ubuntu-latest timeout-minutes: 2 outputs: latest-rc: ${{ steps.latest-rc.outputs.tag }} steps: - name: Find latest RC tag id: latest-rc continue-on-error: true uses: OpenShock/actions/find-latest-tag@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1 with: regex: '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' - name: Set output run: echo "latest-rc=${{ steps.latest-rc.outputs.tag }}" # Delegate building and containerizing to a single workflow. build: needs: [get-latest-tag, get-latest-rc-tag] uses: ./.github/workflows/ci-build.yml with: platforms: linux/amd64,linux/arm64 latest: ${{ needs.get-latest-tag.outputs.latest-tag == github.ref_name }} rc: ${{ needs.get-latest-rc-tag.outputs.latest-rc == github.ref_name }} # Build module base for release assets build-module-base: uses: ./.github/workflows/build-module-base.yml secrets: inherit # Create a draft GitHub release; RC tags are marked as pre-release release: needs: [build, build-module-base] runs-on: ubuntu-latest permissions: contents: write steps: - name: Download Windows installer uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: OpenShock_Desktop_Setup path: artifacts/ - name: Download Linux Photino uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: OpenShock Desktop Photino Linux path: artifacts/photino-linux/ - name: Download Linux AppImage uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: OpenShock Desktop AppImage path: artifacts/ - name: Download Module Base uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: OpenShock Desktop Module Base path: artifacts/module-base/ - name: Package release assets run: | cd artifacts/photino-linux && zip -r ../OpenShock.Desktop.Photino.Linux.zip . && cd ../.. cd artifacts/module-base && zip -r ../OpenShock.Desktop.Module.Base.zip . && cd ../.. - name: Create release uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3.0.4 with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: true prerelease: ${{ contains(github.ref_name, '-rc.') }} generate_release_notes: true files: | artifacts/OpenShock_Desktop_Setup.exe artifacts/OpenShock.Desktop.Photino.Linux.zip artifacts/OpenShock_Desktop-*.AppImage artifacts/OpenShock.Desktop.Module.Base.zip