mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
233 lines
7.2 KiB
233 lines
7.2 KiB
name: Release
|
|
concurrency: build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3.1.0
|
|
|
|
- name: Inject slug/short variables
|
|
uses: rlespinasse/github-slug-action@v4.3.2
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2.1.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2.2.1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2.1.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: BUILD
|
|
uses: docker/build-push-action@v3.2.0
|
|
with:
|
|
push: true
|
|
build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}"
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
tags: squidex/squidex-build
|
|
|
|
test:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3.1.0
|
|
|
|
- name: Inject slug/short variables
|
|
uses: rlespinasse/github-slug-action@v4.3.2
|
|
|
|
- name: Pull from Cache
|
|
run: docker pull squidex/squidex-build
|
|
|
|
- name: Replace Image Name1
|
|
uses: mikefarah/yq@v4.28.2
|
|
with:
|
|
cmd: yq e '.services.squidex1.image = "squidex/squidex-build"' -i backend/tests/docker-compose.yml
|
|
|
|
- name: Replace Image Name2
|
|
uses: mikefarah/yq@v4.28.2
|
|
with:
|
|
cmd: yq e '.services.squidex2.image = "squidex/squidex-build"' -i backend/tests/docker-compose.yml
|
|
|
|
- name: Replace Image Name3
|
|
uses: mikefarah/yq@v4.28.2
|
|
with:
|
|
cmd: yq e '.services.squidex3.image = "squidex/squidex-build"' -i backend/tests/docker-compose.yml
|
|
|
|
- name: Start Test
|
|
run: docker-compose up -d
|
|
working-directory: backend/tests
|
|
|
|
- name: RUN TEST
|
|
uses: kohlerdominik/docker-run-action@v1.1.0
|
|
with:
|
|
image: squidex/build:7
|
|
environment: |
|
|
CONFIG__BACKUPURL=http://localhost:5000
|
|
CONFIG__WAIT=60
|
|
CONFIG__SERVER__URL=http://localhost:8080
|
|
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
|
|
default_network: host
|
|
options: --name test1
|
|
volumes: ${{ github.workspace }}:/src
|
|
run: dotnet test /src/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
|
|
|
|
- name: RUN TEST on path
|
|
uses: kohlerdominik/docker-run-action@v1.1.0
|
|
with:
|
|
image: squidex/build:7
|
|
environment: |
|
|
CONFIG__BACKUPURL=http://localhost:5000
|
|
CONFIG__WAIT=60
|
|
CONFIG__SERVER__URL=http://localhost:8081/squidex
|
|
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
|
|
default_network: host
|
|
options: --name test2
|
|
volumes: ${{ github.workspace }}:/src
|
|
run: dotnet test /src/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
|
|
|
|
- name: RUN TEST with dedicated collections
|
|
uses: kohlerdominik/docker-run-action@v1.1.0
|
|
with:
|
|
image: squidex/build:7
|
|
environment: |
|
|
CONFIG__BACKUPURL=http://localhost:5000
|
|
CONFIG__WAIT=60
|
|
CONFIG__SERVER__URL=http://localhost:8082
|
|
WEBHOOKCATCHER__HOST__ENDPOINT=webhookcatcher
|
|
default_network: host
|
|
options: --name test3
|
|
volumes: ${{ github.workspace }}:/src
|
|
run: dotnet test /src/backend/tools/TestSuite/TestSuite.ApiTests/TestSuite.ApiTests.csproj --filter Category!=NotAutomated
|
|
|
|
- name: Dump docker logs on failure
|
|
if: failure()
|
|
uses: jwalton/gh-docker-logs@v2.2.1
|
|
with:
|
|
images: 'squidex-tmp,squidex/resizer,squidex/caddy-proxy-path'
|
|
tail: '100'
|
|
|
|
- name: Cleanup Test
|
|
if: always()
|
|
run: docker-compose down
|
|
working-directory: backend/tests
|
|
|
|
publish:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3.1.0
|
|
|
|
- name: Inject slug/short variables
|
|
uses: rlespinasse/github-slug-action@v4.3.2
|
|
|
|
- name: Get Major Version
|
|
id: version
|
|
uses: rishabhgupta/split-by@v1
|
|
with:
|
|
string: "${{ env.GITHUB_REF_SLUG }}"
|
|
split-by: "."
|
|
|
|
- name: Check Tag
|
|
id: normal-version
|
|
run: |
|
|
if [[ ${{ env.GITHUB_REF_SLUG }} =~ ^[0-9]+\.[0-9]+$ ]]; then
|
|
echo "STABLE_VERSION=true" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2.1.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2.2.1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2.1.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: BUILD
|
|
uses: docker/build-push-action@v3.2.0
|
|
with:
|
|
push: true
|
|
build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}"
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
tags: |
|
|
squidex/squidex:latest
|
|
squidex/squidex:${{ env.GITHUB_REF_SLUG }}
|
|
squidex/squidex:${{ steps.version.outputs._0 }}
|
|
if: env.STABLE_VERSION == 'true'
|
|
|
|
- name: BUILD
|
|
uses: docker/build-push-action@v3.2.0
|
|
with:
|
|
push: true
|
|
build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}"
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
tags: |
|
|
squidex/squidex:${{ env.GITHUB_REF_SLUG }}
|
|
squidex/squidex:${{ steps.version.outputs._0 }}
|
|
if: env.STABLE_VERSION != 'true'
|
|
|
|
release:
|
|
needs: publish
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3.1.0
|
|
|
|
- name: Inject slug/short variables
|
|
uses: rlespinasse/github-slug-action@v4.3.2
|
|
|
|
- name: Pull from Cache
|
|
run: docker pull squidex/squidex-build
|
|
|
|
- name: Make directories
|
|
run: sudo mkdir /build /release
|
|
|
|
- name: Create container
|
|
run: docker create --name squidex-container squidex/squidex-build
|
|
|
|
- name: Get binaries
|
|
run: sudo docker cp squidex-container:/app/. /build
|
|
|
|
- name: ZIP Binaries
|
|
run: sudo zip -r /release/binaries.zip .
|
|
working-directory: /build
|
|
|
|
- name: Get Changelog Entry
|
|
id: changelog_reader
|
|
uses: mindsers/changelog-reader-action@v2.2.0
|
|
with:
|
|
version: ${{ env.GITHUB_REF_SLUG }}
|
|
path: ./CHANGELOG.md
|
|
|
|
- name: Publish Binaries
|
|
uses: ncipollo/release-action@v1.11.1
|
|
with:
|
|
allowUpdates: true
|
|
artifactErrorsFailBuild: true
|
|
artifacts: "/release/binaries.zip"
|
|
body: ${{ steps.changelog_reader.outputs.changes }}
|
|
name: ${{ env.GITHUB_REF_SLUG }}
|
|
replacesArtifacts: true
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Cleanup Binaries
|
|
if: always()
|
|
run: docker rm squidex-container
|
|
|