Browse Source

Fix cli yml

Jonathan Kelley 1 year ago
parent
commit
49f6b97dd9
1 changed files with 57 additions and 63 deletions
  1. 57 63
      .github/workflows/publish.yml

+ 57 - 63
.github/workflows/publish.yml

@@ -23,11 +23,6 @@ on:
         required: true
         description: Choose the version number to publish with
         type: string
-        # options:
-        #   - main
-        #   - v0.4
-        #   - v0.5
-        #   - v0.6
 
 env:
   # make sure we have the right version
@@ -38,59 +33,9 @@ env:
   # backported automatically
   SEMVER: ${{ github.event.inputs.channel == 'main' && 'prerelease' || 'patch' }}
   PRERELEASE_TAG: ${{ github.event.inputs.channel == 'main' && '-pre' || '' }}
-  RELEASE_TAG: ${{ github.event.inputs.channel }}
+  RELEASE_TAG: ${{ github.event.inputs.channel  }}
 
 jobs:
-  # First, run checks (clippy, tests, etc) and then publish the crates to crates.io
-  # release-crates:
-  #   steps:
-  #     # Checkout the right branch, and the nightly stuff
-  #     - uses: actions/checkout@v4
-  #       ref: ${{ github.event.inputs.channel }}
-  #     - run: sudo apt-get update
-  #     - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
-  #     - uses: dtolnay/rust-toolchain@nightly
-  #       with:
-  #         toolchain: nightly-2024-02-01
-  #     - uses: Swatinem/rust-cache@v2
-  #       with:
-  #         cache-all-crates: "true"
-
-  #     - name: Free Disk Space (Ubuntu)
-  #       uses: jlumbroso/free-disk-space@v1.3.1
-  #       with: # speed things up a bit
-  #         large-packages: false
-  #         docker-images: false
-  #         swap-storage: false
-
-  #     # Just make sure clippy is happy before doing anything else
-  #     # Don't publish versions with clippy errors!
-  #     - name: Clippy
-  #       run: cargo clippy --workspace --all --examples --tests --all-features --all-targets -- -D warnings
-
-  #     # Build the docs here too before publishing, to ensure they're up to date
-  #     - name: cargo doc
-  #       run: RUSTDOCFLAGS="--cfg docsrs" cargo doc --no-deps --workspace --all-features
-
-  #     - name: Publish to crates.io
-  #       run: |
-  #         git config --global user.email "github-actions[bot]@users.noreply.github.com"
-  #         git config --global user.name "github-actions[bot]"
-  #         cargo workspaces version -y ${{ env.SEMVER }} --pre-id rc --no-git-commit
-
-  #         # todo: actually just publish!
-  #         # cargo workspaces publish -y ${{ github.event.inputs.semver }}
-
-      # this will be more useful when we publish the website with updated docs
-      # Build the docs.rs docs and publish them to the website under the right folder
-      # v0.4.x -> docs/0.4
-      # v0.5.x -> docs/0.5 etc
-      # main -> docs/nightly
-      # strip the v from the channel, and the .x from the end, and replace main with nightly
-      # - name: determine docs folder by channel
-      #   id: determine_docs_folder
-      #   run: echo "::set-output name=folder::$(echo ${{ github.event.inputs.channel }} | sed 's/v//g' | sed 's/\.x//g' | sed 's/main/nightly/g')"
-
   # Build the CLI for all platforms, uploading the artifacts to our releases page
   release-cli:
     needs: release-crates
@@ -115,19 +60,17 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
-        ref: ${{ github.event.inputs.channel }}
 
       - name: Install stable
         uses: dtolnay/rust-toolchain@master
         with:
-          toolchain: "1.70.0"
+          toolchain: "1.75.0"
           targets: ${{ matrix.platform.target }}
 
-
-      - name: Setup cache
-        uses: Swatinem/rust-cache@v2
+      - uses: Swatinem/rust-cache@v2
         with:
-          workspaces: packages/cli -> ../../target
+          cache-all-crates: "true"
+          save-if: ${{ github.ref == 'refs/heads/main' }}
 
       - name: Free Disk Space
         uses: jlumbroso/free-disk-space@v1.3.1
@@ -143,7 +86,7 @@ jobs:
           bin: dx
           token: ${{ secrets.GITHUB_TOKEN }}
           target: ${{ matrix.platform.target }}
-          archive: dx-${{ matrix.platform.target }}${{ env.RELEASE_TAG }}
+          archive: dx-${{ matrix.platform.target }}${{ env.PRERELEASE_TAG }}
           checksum: sha256
           manifest_path: packages/cli/Cargo.toml
 
@@ -152,3 +95,54 @@ jobs:
   # release-benchmarks:
   # Build the vscode extension, uploading the artifact to the marketplace
   # release-extension:
+
+  # First, run checks (clippy, tests, etc) and then publish the crates to crates.io
+  # release-crates:
+  #   steps:
+  #     # Checkout the right branch, and the nightly stuff
+  #     - uses: actions/checkout@v4
+  #       ref: ${{ github.event.inputs.channel }}
+  #     - run: sudo apt-get update
+  #     - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
+  #     - uses: dtolnay/rust-toolchain@nightly
+  #       with:
+  #         toolchain: nightly-2024-02-01
+  #     - uses: Swatinem/rust-cache@v2
+  #       with:
+  #         cache-all-crates: "true"
+
+  #     - name: Free Disk Space (Ubuntu)
+  #       uses: jlumbroso/free-disk-space@v1.3.1
+  #       with: # speed things up a bit
+  #         large-packages: false
+  #         docker-images: false
+  #         swap-storage: false
+
+  #     # Just make sure clippy is happy before doing anything else
+  #     # Don't publish versions with clippy errors!
+  #     - name: Clippy
+  #       run: cargo clippy --workspace --all --examples --tests --all-features --all-targets -- -D warnings
+
+  #     # Build the docs here too before publishing, to ensure they're up to date
+  #     - name: cargo doc
+  #       run: RUSTDOCFLAGS="--cfg docsrs" cargo doc --no-deps --workspace --all-features
+
+  #     - name: Publish to crates.io
+  #       run: |
+  #         git config --global user.email "github-actions[bot]@users.noreply.github.com"
+  #         git config --global user.name "github-actions[bot]"
+  #         cargo workspaces version -y ${{ env.SEMVER }} --pre-id rc --no-git-commit
+
+  #         # todo: actually just publish!
+  #         # cargo workspaces publish -y ${{ github.event.inputs.semver }}
+
+      # this will be more useful when we publish the website with updated docs
+      # Build the docs.rs docs and publish them to the website under the right folder
+      # v0.4.x -> docs/0.4
+      # v0.5.x -> docs/0.5 etc
+      # main -> docs/nightly
+      # strip the v from the channel, and the .x from the end, and replace main with nightly
+      # - name: determine docs folder by channel
+      #   id: determine_docs_folder
+      #   run: echo "::set-output name=folder::$(echo ${{ github.event.inputs.channel }} | sed 's/v//g' | sed 's/\.x//g' | sed 's/main/nightly/g')"
+