From 56bc9b666a2e63618e72c9de5027cac04df463ff Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 6 Jul 2022 00:29:46 +0200 Subject: [PATCH] ci: publish lsp only on new releases --- .github/workflows/lsp_on_release.yml | 41 --------------------------- .github/workflows/pypi_on_release.yml | 33 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/lsp_on_release.yml diff --git a/.github/workflows/lsp_on_release.yml b/.github/workflows/lsp_on_release.yml deleted file mode 100644 index 68075fd6b3..0000000000 --- a/.github/workflows/lsp_on_release.yml +++ /dev/null @@ -1,41 +0,0 @@ -env: - LOCAL_REGISTRY: registry.wimill.xyz - IMAGE_NAME: ${{ github.repository }} - -name: Publish LSP Server -on: - push: - branches: [main] - paths: - - "python-client/**" - - "lsp/**" - tags: - - "*" -jobs: - build: - runs-on: [self-hosted, new] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Docker meta local - id: metalocal - uses: docker/metadata-action@v4 - with: - images: ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: "{{defaultContext}}:lsp" - push: true - tags: ${{ steps.metalocal.outputs.tags }} - labels: ${{ steps.metalocal.outputs.labels }} - cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache - cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache,mode=max diff --git a/.github/workflows/pypi_on_release.yml b/.github/workflows/pypi_on_release.yml index c2531b474c..f5cd4dcaf4 100644 --- a/.github/workflows/pypi_on_release.yml +++ b/.github/workflows/pypi_on_release.yml @@ -1,3 +1,7 @@ +env: + LOCAL_REGISTRY: registry.wimill.xyz + IMAGE_NAME: ${{ github.repository }} + name: Publish python-client on: push: @@ -17,3 +21,32 @@ jobs: export PATH=$PATH:/usr/local/bin export PATH=$PATH:/root/.local/bin ./publish.sh + + publish_lsp: + needs: [publish_pypi] + runs-on: [self-hosted, new] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Docker meta local + id: metalocal + uses: docker/metadata-action@v4 + with: + images: ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: "{{defaultContext}}:lsp" + push: true + tags: ${{ steps.metalocal.outputs.tags }} + labels: ${{ steps.metalocal.outputs.labels }} + cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache + cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache,mode=max