Skip to content

Commit

Permalink
ci: Automate more of the release process (no-changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Aug 20, 2024
1 parent eecb804 commit 18d47d3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 56 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Test Postgres and MySQL schemas
on:
schedule:
- cron: '0 0 * * *'
workflow_call:
workflow_dispatch:
pull_request:
paths:
Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/docker-images.yml

This file was deleted.

70 changes: 63 additions & 7 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ on:
- 'release/*'

jobs:
publish-release:
publish-to-npm:
name: Publish to NPM
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

timeout-minutes: 60
timeout-minutes: 10
env:
NPM_CONFIG_PROVENANCE: true

Expand Down Expand Up @@ -51,6 +47,66 @@ jobs:
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc --no-git-checks
npm dist-tag rm n8n rc
publish-to-docker-hub:
name: Publish to DockerHub
needs: [publish-to-npm]
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to DockerHub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set release version in env
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV

- name: Build
uses: docker/build-push-action@v5.1.0
with:
context: ./docker/images/n8n
build-args: |
N8N_VERSION=${{ env.RELEASE }}
platforms: linux/amd64,linux/arm64
provenance: false
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ env.RELEASE }}
ghcr.io/${{ github.repository_owner }}/n8n:${{ env.RELEASE }}
create-github-release:
name: Create a GitHub Release
needs: [publish-to-npm, publish-to-docker-hub]
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
timeout-minutes: 10

permissions:
contents: write
id-token: write

steps:
- name: Create a Release on GitHub
uses: ncipollo/release-action@v1
with:
Expand Down

0 comments on commit 18d47d3

Please sign in to comment.