From 9ba45fa9c6105030f2e7f89ba45e3fc029b3990b Mon Sep 17 00:00:00 2001 From: gavinleroy Date: Fri, 30 Aug 2024 14:04:33 -0400 Subject: [PATCH] CI release action --- .github/workflows/release.yml | 17 ++--------------- flake.nix | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 543981e..2bd33ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,27 +13,14 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - uses: DeterminateSystems/flake-checker-action@main - - run: nix develop --command cargo ws publish skip --no-remove-dev-deps --from-git --yes --token ${{ secrets.CRATES_IO }} + - run: nix develop --command ci-crate-pub ${{ secrets.CRATES_IO }} publish-ide: runs-on: ubuntu-latest needs: publish-crates steps: - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - uses: DeterminateSystems/flake-checker-action@main - - - name: Build TS bindings - run: nix develop --command cargo make init-bindings - - - name: Depot Setup - run: nix develop --command depot setup - - - name: Publish Extension - run: | - cd ide/packages/extension - nix develop --command vsce package - nix develop --command vsce publish -p ${{ secrets.VSCODE_MRKT }} --packagePath argus-*.vsix - nix develop --command pnpx ovsx publish argus-*.vsix -p ${{ secrets.OVSX_MRKT }} + - run: nix develop --command ci-ext-pub ${{ secrets.VSCODE_MRKT }} ${{ secrets.OVSX_MRKT }} diff --git a/flake.nix b/flake.nix index af564a8..07973af 100644 --- a/flake.nix +++ b/flake.nix @@ -58,11 +58,27 @@ codespell . cargo test ''; + + publishCrates = pkgs.writeScriptBin "ci-crate-pub" '' + cargo ws publish skip --no-remove-dev-deps --from-git --yes --token "$1" + ''; + + publishExtension = pkgs.writeScriptBin "ci-ext-pub" '' + cargo make init-bindings + cd ide + depot setup + cd packages/extension + vsce package + vsce publish -p "$1" --packagePath argus-*.vsix + pnpx ovsx publish argus-*.vsix -p "$2" + ''; in { devShell = with pkgs; mkShell { nativeBuildInputs = [ pkg-config ]; buildInputs = [ checkProject + publishCrates + publishExtension llvmPackages_latest.llvm llvmPackages_latest.lld