diff --git a/.github/workflows/build-optimized-ucm.yaml b/.github/workflows/build-optimized-ucm.yaml deleted file mode 100644 index bc0c6199b7..0000000000 --- a/.github/workflows/build-optimized-ucm.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: build optimized ucm - -on: - workflow_call: - inputs: - ref: - description: Git ref to check out for this build, e.g. `trunk` or `release/0.5.19` - type: string - required: true - stack-cache-prefix: - description: The Stack cache prefix to use for builds - type: string - default: release - -defaults: - run: - shell: bash - -jobs: - build-ucm: - name: bundle ucm+ui ${{matrix.os}} - runs-on: ${{matrix.os}} - strategy: - fail-fast: false - matrix: - os: [ubuntu-20.04, macos-12, windows-2019] - steps: - - uses: actions/checkout@v4 - with: - ref: ${{inputs.ref}} - - - name: restore stack caches - uses: unisonweb/actions/stack/cache/restore@main - with: - cache-prefix: release - - - name: install stack - uses: unisonweb/actions/stack/install@main - - - name: build - run: | - # unison-cli embeds version numbers using TH - # so it needs to be forced to rebuild to ensure those are updated. - stack clean unison-cli - - # Windows will crash on build intermittently because the filesystem - # sucks at managing concurrent file access; - # Just keep retrying on these failures. - tries=5 - for (( i = 0; i < $tries; i++ )); do - stack build --flag unison-parser-typechecker:optimized && break; - done - - - name: save stack caches - uses: unisonweb/actions/stack/cache/save@main - with: - cache-prefix: release - - - name: set up environment - run: | - if [[ ${{runner.os}} = 'Windows' ]]; then - artifact_os="windows" - elif [[ ${{runner.os}} = 'macOS' ]]; then - artifact_os="osx" - elif [[ ${{runner.os}} = 'Linux' ]]; then - artifact_os="linux" - else - echo "Unexpected OS: ${{runner.os}}" - exit 1 - fi - echo "artifact_os=$artifact_os" >> $GITHUB_ENV - - - name: fetch latest Unison Local UI and package with ucm - run: | - mkdir /tmp/ucm - cp -v $(stack exec -- which unison) /tmp/ucm/ucm - - curl -L -o /tmp/unisonLocal.zip \ - https://github.com/unisonweb/unison-local-ui/releases/download/latest/unisonLocal.zip - mkdir /tmp/ucm/ui - unzip -d /tmp/ucm/ui /tmp/unisonLocal.zip - - if [[ ${{runner.os}} = 'Windows' ]]; then - artifact_archive=ucm-${{env.artifact_os}}.zip - 7z a -r -tzip ${artifact_archive} /tmp/ucm/* - else - artifact_archive=ucm-${{env.artifact_os}}.tar.gz - tar -c -z -f ${artifact_archive} -C /tmp/ucm . - fi - echo "artifact_archive=${artifact_archive}" >> $GITHUB_ENV - - - name: upload artifact - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: build-${{env.artifact_os}} - path: ${{env.artifact_archive}} diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index e3d713c7c4..46eb22aefa 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -1,4 +1,5 @@ -name: pre-release +name: pre-release v2 +run-name: pre-release v2 ${{inputs.version}} defaults: run: @@ -14,7 +15,7 @@ on: jobs: build-ucm: - uses: ./.github/workflows/build-optimized-ucm.yaml + uses: ./.github/workflows/bundle-ucm.yaml with: ref: ${{ github.ref }} @@ -42,3 +43,4 @@ jobs: files: | /tmp/ucm/**/*.tar.gz /tmp/ucm/**/*.zip + /tmp/ucm/**/*.zip.CHECKSUM diff --git a/.github/workflows/pre-release2.yaml b/.github/workflows/pre-release2.yaml deleted file mode 100644 index 905d1a18f3..0000000000 --- a/.github/workflows/pre-release2.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: pre-release v2 -run-name: pre-release v2 ${{inputs.version}} - - -defaults: - run: - shell: bash - -on: - workflow_run: - workflows: ["CI"] - branches: [ trunk ] - types: - - completed - workflow_dispatch: - -jobs: - build-ucm: - uses: ./.github/workflows/bundle-ucm.yaml - with: - ref: ${{ github.ref }} - - release: - name: create release - runs-on: ubuntu-20.04 - needs: - - build-ucm - - steps: - - name: make download dir - run: mkdir /tmp/ucm - - - name: "download artifacts" - uses: actions/download-artifact@v2 - with: - path: /tmp/ucm - - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "trunk-build" - prerelease: true - title: "Development Build" - files: | - /tmp/ucm/**/*.tar.gz - /tmp/ucm/**/*.zip - /tmp/ucm/**/*.zip.CHECKSUM diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3b88f3b613..a7ee5db246 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,6 +1,6 @@ -name: "release" +name: release v2 -run-name: "release ${{inputs.version}}" +run-name: release v2 ${{inputs.version}} defaults: run: @@ -21,7 +21,7 @@ on: jobs: build-ucm: - uses: ./.github/workflows/build-optimized-ucm.yaml + uses: ./.github/workflows/bundle-ucm.yaml with: ref: release/${{inputs.version}} @@ -54,7 +54,7 @@ jobs: if [ -z "$prev_tag" ]; then echo "No previous release found"; exit 1; fi echo "Creating a release from these artifacts:" - ls -R /tmp/ucm + ls -R /tmp/ucm/**/*.{zip,tar.gz,zip.CHECKSUM} gh release create "release/${version}" \ @@ -63,4 +63,4 @@ jobs: --generate-notes \ --notes-start-tag "${prev_tag}" \ \ - /tmp/ucm/**/*.{zip,tar.gz} + /tmp/ucm/**/*.{zip,tar.gz,zip.CHECKSUM} diff --git a/.github/workflows/release2.yaml b/.github/workflows/release2.yaml deleted file mode 100644 index a7ee5db246..0000000000 --- a/.github/workflows/release2.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: release v2 - -run-name: release v2 ${{inputs.version}} - -defaults: - run: - shell: bash - -on: - workflow_dispatch: - inputs: - version: - description: Release version; e.g. `0.5.19`. We'll create tag `release/${version}`. - required: true - type: string - target: - description: Git ref to use for this release; defaults to `trunk`. - required: true - default: trunk - type: string - -jobs: - build-ucm: - uses: ./.github/workflows/bundle-ucm.yaml - with: - ref: release/${{inputs.version}} - - release: - name: create release - runs-on: ubuntu-20.04 - needs: - - build-ucm - - steps: - - name: make download dir - run: mkdir /tmp/ucm - - - name: "download artifacts" - uses: actions/download-artifact@v2 - with: - path: /tmp/ucm - - - name: Create Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - version="${{inputs.version}}" - target="${{inputs.target}}" - prev_tag="$( \ - gh release view \ - --repo unisonweb/unison \ - --json tagName -t '{{printf .tagName}}' \ - )" - if [ -z "$prev_tag" ]; then echo "No previous release found"; exit 1; fi - - echo "Creating a release from these artifacts:" - ls -R /tmp/ucm/**/*.{zip,tar.gz,zip.CHECKSUM} - - - gh release create "release/${version}" \ - --repo unisonweb/unison \ - --target "${target}" \ - --generate-notes \ - --notes-start-tag "${prev_tag}" \ - \ - /tmp/ucm/**/*.{zip,tar.gz,zip.CHECKSUM}