From 6a7c3220b0de58498c714b6c6664399487edbfcd Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 19 Aug 2022 08:40:00 -0700 Subject: [PATCH] refactor(ci): combine publish workflows (#5471) * refactor(ci): combine publish workflows * fixup! refactor(ci): combine publish workflows --- .github/workflows/docker.yaml | 60 ------------------- .../workflows/{npm-brew.yaml => publish.yaml} | 44 +++++++++++++- 2 files changed, 43 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/docker.yaml rename .github/workflows/{npm-brew.yaml => publish.yaml} (75%) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index ff56b3fdf..000000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Publish on Docker - -on: - # Shows the manual trigger in GitHub UI - # helpful as a back-up in case the GitHub Actions Workflow fails - workflow_dispatch: - - release: - types: - - released - -# Cancel in-progress runs for pull requests when developers push -# additional changes, and serialize builds in branches. -# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -jobs: - docker-images: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Get version - id: version - run: echo "::set-output name=version::$(jq -r .version package.json)" - - - name: Download release artifacts - uses: robinraju/release-downloader@v1.4 - with: - repository: "coder/code-server" - tag: v${{ steps.version.outputs.version }} - fileName: "*.deb" - out-file-path: "release-packages" - - - name: Publish to Docker - run: yarn publish:docker - env: - GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/publish.yaml similarity index 75% rename from .github/workflows/npm-brew.yaml rename to .github/workflows/publish.yaml index 2e2f94e46..7e2e73934 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/publish.yaml @@ -1,4 +1,4 @@ -name: Publish on npm and brew +name: Publish code-server on: # Shows the manual trigger in GitHub UI @@ -21,6 +21,7 @@ jobs: npm: runs-on: ubuntu-latest steps: + - name: Checkout code-server - uses: actions/checkout@v3 - name: Get version @@ -116,3 +117,44 @@ jobs: git commit -m "chore: updating version to ${{ steps.version.outputs.version }}" git push -u origin $(git branch --show) gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ steps.version.outputs.version }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR + docker: + runs-on: ubuntu-20.04 + steps: + - name: Checkout code-server + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get version + id: version + run: echo "::set-output name=version::$(jq -r .version package.json)" + + - name: Download release artifacts + uses: robinraju/release-downloader@v1.4 + with: + repository: "coder/code-server" + tag: v${{ steps.version.outputs.version }} + fileName: "*.deb" + out-file-path: "release-packages" + + - name: Publish to Docker + run: yarn publish:docker + env: + GITHUB_TOKEN: ${{ github.token }}