refactor(ci): combine publish workflows (#5471)

* refactor(ci): combine publish workflows

* fixup! refactor(ci): combine publish workflows
This commit is contained in:
Joe Previte 2022-08-19 08:40:00 -07:00 committed by GitHub
parent 9d8588b2ed
commit 6a7c3220b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 61 deletions

View File

@ -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 }}

View File

@ -1,4 +1,4 @@
name: Publish on npm and brew name: Publish code-server
on: on:
# Shows the manual trigger in GitHub UI # Shows the manual trigger in GitHub UI
@ -21,6 +21,7 @@ jobs:
npm: npm:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code-server
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get version - name: Get version
@ -116,3 +117,44 @@ jobs:
git commit -m "chore: updating version to ${{ steps.version.outputs.version }}" git commit -m "chore: updating version to ${{ steps.version.outputs.version }}"
git push -u origin $(git branch --show) 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 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 }}