Add .github configs for monorepo
This commit is contained in:
parent
c1b11272be
commit
fb04b735a6
16
.github/PULL_REQUEST_TEMPLATE
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
Please take a look.
|
||||
|
||||
<!--
|
||||
Checklist:
|
||||
|
||||
1. API changes have been discussed,
|
||||
2. Source code must be formatted (`go fmt`, `yarn lint`),
|
||||
3. Codegen shouldn't produce modified files,
|
||||
4. Builds pass,
|
||||
5. Tests pass,
|
||||
6. Linked to relevant issues
|
||||
|
||||
When you are writing pull request title and describing changes, follow
|
||||
commit message format in the CONTRIBUTING.md in the codebase root.
|
||||
|
||||
-->
|
||||
BIN
.github/assets/corteza_dashboard.png
vendored
Normal file
BIN
.github/assets/corteza_dashboard.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 696 KiB |
1
.github/assets/corteza_logo.svg
vendored
Normal file
1
.github/assets/corteza_logo.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 241.45 38.63"><defs><style>.cls-1{fill:#95b4af;}</style></defs><path class="cls-1" d="M2.51,9.38A18,18,0,0,1,9.37,2.51,19.49,19.49,0,0,1,19.13.05,19.15,19.15,0,0,1,30.21,3.3a17,17,0,0,1,6.64,9h-8.7A9,9,0,0,0,24.5,8.21a10.67,10.67,0,0,0-5.43-1.35A11.24,11.24,0,0,0,13.21,8.4a10.6,10.6,0,0,0-4,4.35,14.41,14.41,0,0,0-1.43,6.59,14.44,14.44,0,0,0,1.43,6.57,10.55,10.55,0,0,0,4,4.38,11.24,11.24,0,0,0,5.86,1.54,10.49,10.49,0,0,0,5.43-1.38,9.16,9.16,0,0,0,3.65-4.08h8.7a16.92,16.92,0,0,1-6.62,9,19.27,19.27,0,0,1-11.1,3.21,19.49,19.49,0,0,1-9.76-2.46,18,18,0,0,1-6.86-6.83A19.69,19.69,0,0,1,0,19.34,19.76,19.76,0,0,1,2.51,9.38Z"/><path class="cls-1" d="M50.43,36.15a18.53,18.53,0,0,1-7-6.89,19.28,19.28,0,0,1-2.59-10A19.13,19.13,0,0,1,43.4,9.38a18.46,18.46,0,0,1,7-6.89,20.29,20.29,0,0,1,19.48,0,18.37,18.37,0,0,1,7,6.89,19.31,19.31,0,0,1,2.56,9.91,19.45,19.45,0,0,1-2.56,10,18.38,18.38,0,0,1-7,6.89,20.31,20.31,0,0,1-19.45,0Zm15.72-5.81a10.53,10.53,0,0,0,4-4.4,14.38,14.38,0,0,0,1.46-6.65,14.2,14.2,0,0,0-1.46-6.62,10.4,10.4,0,0,0-4-4.35,12.72,12.72,0,0,0-12,0,10.34,10.34,0,0,0-4.08,4.35,14.32,14.32,0,0,0-1.46,6.62,14.51,14.51,0,0,0,1.46,6.65,10.47,10.47,0,0,0,4.08,4.4,12.5,12.5,0,0,0,12,0Z"/><path class="cls-1" d="M103.92,38.26,95.6,23.56H92v14.7H84.47V.54H98.62a16.49,16.49,0,0,1,7.46,1.54,10.8,10.8,0,0,1,4.62,4.16,11.32,11.32,0,0,1,1.54,5.86,11.23,11.23,0,0,1-2.16,6.73A11,11,0,0,1,103.65,23l9,15.3ZM92,17.89h6.32A6.33,6.33,0,0,0,103,16.4a5.52,5.52,0,0,0,1.51-4.13,5.29,5.29,0,0,0-1.51-4,6.5,6.5,0,0,0-4.6-1.43H92Z"/><path class="cls-1" d="M142.88.54V6.65h-10V38.26h-7.57V6.65H115.21V.54Z"/><path class="cls-1" d="M155.32,6.65V16.1H168v6h-12.7v10h14.32v6.16H147.75V.49h21.89V6.65Z"/><path class="cls-1" d="M185.42,31.88h17v6.38H176.66V32.42l16.86-25.5H176.66V.54h25.72V6.38Z"/><path class="cls-1" d="M231,31.07H216l-2.49,7.19h-7.94L219.08.49h8.81l13.56,37.77h-8ZM228.91,25,223.46,9.24,218,25Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
95
.github/workflows/notify.yml
vendored
Normal file
95
.github/workflows/notify.yml
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
name: Notify matrix chat server on GitHub events
|
||||
|
||||
on:
|
||||
issues:
|
||||
issue_comment:
|
||||
release:
|
||||
pull_request_review_comment:
|
||||
types: [ created ]
|
||||
pull_request:
|
||||
types: [ opened, reopened, closed ]
|
||||
workflow_run:
|
||||
workflows: [release]
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
send-message:
|
||||
runs-on: ubuntu-latest
|
||||
name: Send message via Matrix on issue
|
||||
steps:
|
||||
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: |
|
||||
echo "$GITHUB_CONTEXT"
|
||||
|
||||
# only if not a comment
|
||||
- name: Send message on issue
|
||||
if: ${{ !github.event.comment && github.event.issue }}
|
||||
id: matrix-chat-issue
|
||||
uses: fadenb/matrix-chat-message@v0.0.6
|
||||
with:
|
||||
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
|
||||
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
channel: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
message: |
|
||||
### [ ${{ github.event.repository.name }} ]
|
||||
An issue has been **${{ github.event.action }}** by ${{ github.triggering_actor }}\
|
||||
More info [here](${{ github.event.issue.html_url }})
|
||||
|
||||
# only for comments
|
||||
- name: Send message on issue comment
|
||||
if: github.event_name == 'issue_comment'
|
||||
id: matrix-chat-issue-comment
|
||||
uses: fadenb/matrix-chat-message@v0.0.6
|
||||
with:
|
||||
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
|
||||
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
channel: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
message: |
|
||||
### [ ${{ github.event.repository.name }} ]
|
||||
An issue comment has been **${{ github.event.action }}** by ${{ github.triggering_actor }}\
|
||||
More info [here](${{ github.event.issue.html_url }})
|
||||
|
||||
# only for releases
|
||||
- name: Send message on release
|
||||
if: github.event_name == 'release'
|
||||
id: matrix-chat-release
|
||||
uses: fadenb/matrix-chat-message@v0.0.6
|
||||
with:
|
||||
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
|
||||
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
channel: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
message: |
|
||||
### [ ${{ github.event.repository.name }} ]
|
||||
A release **${{ github.event.release.tag_name }}** has been **${{ github.event.action }}** by ${{ github.event.release.author.login }}\
|
||||
More info [here](${{ github.event.release.html_url }})
|
||||
|
||||
# only for PR comments
|
||||
- name: Send message on PR comment
|
||||
if: github.event_name == 'pull_request_review_comment'
|
||||
id: matrix-chat-pr-commented
|
||||
uses: fadenb/matrix-chat-message@v0.0.6
|
||||
with:
|
||||
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
|
||||
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
channel: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
message: |
|
||||
### [ ${{ github.event.repository.name }} ]
|
||||
A Pull Request has been **commented on** by ${{ github.event.sender.login }}\
|
||||
More info [here](${{ github.event.pull_request._links.html.href }})
|
||||
|
||||
# only for PR actions
|
||||
- name: Send message on PR action
|
||||
if: github.event_name == 'pull_request'
|
||||
id: matrix-chat-pr
|
||||
uses: fadenb/matrix-chat-message@v0.0.6
|
||||
with:
|
||||
homeserver: ${{ secrets.MATRIX_HOME_SERVER }}
|
||||
token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
channel: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
message: |
|
||||
### [ ${{ github.event.repository.name }} ]
|
||||
A Pull Request has been **${{ github.event.action }}** by ${{ github.event.sender.login }}\
|
||||
More info [here](${{ github.event.pull_request._links.html.href }})
|
||||
456
.github/workflows/release.yml
vendored
Normal file
456
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,456 @@
|
||||
name: "Release"
|
||||
|
||||
# These jobs can be tested with nektos/act tool
|
||||
# https://github.com/nektos/act
|
||||
#
|
||||
# Look for "!env.ACT" in the DRY_RUN expression below
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
env:
|
||||
BUILD_OS: linux
|
||||
BUILD_ARCH: amd64
|
||||
|
||||
GO_VERSION: 1.18
|
||||
GOFLAGS: -mod=readonly
|
||||
|
||||
NODE_VERSION: 16
|
||||
|
||||
RELEASE_BASE_URL: "https://releases.cortezaproject.org/files"
|
||||
|
||||
jobs:
|
||||
server-test:
|
||||
name: "Server tests"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GOFLAGS: -mod=readonly
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: "${{ env.GO_VERSION }}" }
|
||||
- name: "Unit"
|
||||
working-directory: server
|
||||
run: make test.unit
|
||||
- name: "Store"
|
||||
working-directory: server
|
||||
run: make test.store
|
||||
- name: "Integration"
|
||||
working-directory: server
|
||||
run: make test.integration
|
||||
|
||||
# Building web console for server and cache it for release-* steps
|
||||
# we'll do this in parallel with tests to gain a few seconds
|
||||
server-web-console-build:
|
||||
name: "Server Web Console Build"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with: { node-version: "${{ env.NODE_VERSION }}" }
|
||||
- uses: actions/cache@v3
|
||||
if: ${{ !env.ACT }}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.OS }}-node-
|
||||
- name: "Setup YARN"
|
||||
run: npm install -g yarn @vue/cli-service
|
||||
- name: "Install dependencies"
|
||||
working-directory: server/webconsole
|
||||
run: yarn install
|
||||
- name: "Build Package"
|
||||
working-directory: server/webconsole
|
||||
run: yarn build
|
||||
- name: "Cache console build"
|
||||
uses: actions/cache@v3
|
||||
with: { path: ./server/webconsole/dist, key: console-build }
|
||||
|
||||
server-release:
|
||||
name: "Server Release (${{ matrix.os }})"
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- { runsOn: "ubuntu-latest", os: "linux" }
|
||||
- { runsOn: "macos-latest", os: "darwin" }
|
||||
runs-on: ${{ matrix.runsOn }}
|
||||
needs: [ server-web-console-build, server-test ]
|
||||
env:
|
||||
BUILD_OS: ${{ matrix.os }}
|
||||
RELEASE_SFTP_KEY: ${{ secrets.RELEASE_SFTP_KEY }}
|
||||
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
|
||||
steps:
|
||||
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: "${{ env.GO_VERSION }}" }
|
||||
# - name: "Restore web console dist from cache"
|
||||
# uses: actions/cache@v3
|
||||
# with: { path: ./server/webconsole/dist, key: console-build }
|
||||
|
||||
- name: "Copy essentials"
|
||||
run: cp *.md DCO LICENSE server/
|
||||
- name: "Build"
|
||||
working-directory: server
|
||||
run: make release-clean release
|
||||
- name: "Upload"
|
||||
working-directory: server
|
||||
run: make upload
|
||||
if: ${{ !env.ACT }}
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
########################################################################################################################
|
||||
# Libs
|
||||
|
||||
lib-test:
|
||||
name: "Library test (${{ matrix.lib }})"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
lib: [ "js", "vue" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/cache@v3
|
||||
if: ${{ !env.ACT }}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.OS }}-node-${{ matrix.lib }}
|
||||
- name: "Setup YARN"
|
||||
run: npm install -g yarn @vue/cli-service
|
||||
- name: "Install dependencies"
|
||||
working-directory: lib/${{ matrix.lib }}
|
||||
run: yarn install
|
||||
- name: "Run all tests"
|
||||
working-directory: lib/${{ matrix.lib }}
|
||||
run: yarn test:unit
|
||||
|
||||
lib-build-and-publish:
|
||||
name: "Publish libraries (${{ matrix.lib }})"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ lib-test ]
|
||||
strategy:
|
||||
matrix:
|
||||
lib: [ "js", "vue" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
registry-url: 'https://registry.npmjs.org/'
|
||||
- uses: actions/cache@v3
|
||||
if: ${{ !env.ACT }}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.OS }}-node-${{ matrix.lib }}
|
||||
- name: "Setup YARN"
|
||||
run: npm install -g yarn @vue/cli-service
|
||||
- name: "Install dependencies"
|
||||
working-directory: lib/${{ matrix.lib }}
|
||||
run: yarn install
|
||||
- name: "Build Package"
|
||||
working-directory: lib/${{ matrix.lib }}
|
||||
run: yarn build
|
||||
- name: "Dry Run Publish"
|
||||
working-directory: lib/${{ matrix.lib }}
|
||||
run: npm publish --dry-run
|
||||
|
||||
# invalid secret?
|
||||
# - name: "Publish"
|
||||
# working-directory: lib/${{ matrix.lib }}
|
||||
# run: npm publish
|
||||
# env: { NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" }
|
||||
# if: ${{ !env.ACT }}
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
########################################################################################################################
|
||||
# Web clients
|
||||
|
||||
|
||||
client-web-test:
|
||||
name: "Web client test (${{ matrix.app }})"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix: { app: [ admin, compose, discovery, privacy, reporter, one, workflow ] }
|
||||
needs: [ "lib-build-and-publish" ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with: { node-version: "${{ env.NODE_VERSION }}" }
|
||||
- name: "Setup YARN"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: npm install -g yarn @vue/cli-service
|
||||
- name: "Cache"
|
||||
uses: actions/cache@v3
|
||||
if: ${{ !env.ACT }}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.OS }}-node-
|
||||
- name: "Dependencies"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make dep
|
||||
- name: "Tests"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make test
|
||||
|
||||
|
||||
client-web-release:
|
||||
name: "Web client (${{ matrix.app }})"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix: { app: [ admin, compose, discovery, privacy, reporter, one, workflow ] }
|
||||
needs: [ client-web-test ]
|
||||
env:
|
||||
RELEASE_SFTP_KEY: ${{ secrets.RELEASE_SFTP_KEY }}
|
||||
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
|
||||
steps:
|
||||
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with: { node-version: "${{ env.NODE_VERSION }}" }
|
||||
- name: "Setup YARN"
|
||||
run: npm install -g yarn @vue/cli-service
|
||||
- name: "Cache"
|
||||
uses: actions/cache@v3
|
||||
if: ${{ !env.ACT }}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.OS }}-node-
|
||||
- name: "Dependencies"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make dep
|
||||
- name: "Build"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make build
|
||||
- name: "Copy essentials"
|
||||
run: cp *.md DCO LICENSE client/web/${{ matrix.app }}
|
||||
- name: "Release"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make release
|
||||
- name: "Upload"
|
||||
working-directory: client/web/${{ matrix.app }}
|
||||
run: make upload
|
||||
if: ${{ !env.ACT }}
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
client-web-aio-release:
|
||||
name: "Web clients (all-in-one release)"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ client-web-release ]
|
||||
env:
|
||||
RELEASE_SFTP_KEY: ${{ secrets.RELEASE_SFTP_KEY }}
|
||||
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- name: "Prepare dist dir"
|
||||
run: |
|
||||
mkdir -p \
|
||||
client/web/dist/admin \
|
||||
client/web/dist/compose \
|
||||
client/web/dist/workflow \
|
||||
client/web/dist/reporter \
|
||||
client/web/dist/discovery \
|
||||
client/web/dist/privacy
|
||||
- name: "Download & unpack one"
|
||||
run: |
|
||||
curl --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-one-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist
|
||||
- name: "Download & unpack admin"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-admin-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/admin
|
||||
- name: "Download & unpack compose"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-compose-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/compose
|
||||
- name: "Download & unpack workflow"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-workflow-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/workflow
|
||||
- name: "Download & unpack reporter"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-reporter-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/reporter
|
||||
- name: "Download & unpack discovery"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-discovery-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/discovery
|
||||
- name: "Download & unpack privacy"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-privacy-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C client/web/dist/privacy
|
||||
- name: "Copy essentials"
|
||||
run: cp *.md DCO LICENSE client/web/dist/
|
||||
- name: "Pack all web clients"
|
||||
working-directory: client/web
|
||||
run: tar -C dist -czf corteza-webapp-${{ env.BUILD_VERSION }}.tar.gz $(dir dist)
|
||||
- name: "Upload"
|
||||
working-directory: client/web
|
||||
run: |
|
||||
echo ${{ env.RELEASE_SFTP_KEY }} | base64 -d > .upload-rsa && chmod 0400 .upload-rsa
|
||||
echo "put corteza-webapp-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
sftp -q -o "StrictHostKeyChecking no" -i .upload-rsa ${{ env.RELEASE_SFTP_URI }}
|
||||
rm -f .upload-rsa
|
||||
if: ${{ !env.ACT }}
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
########################################################################################################################
|
||||
# This is where it all comes together
|
||||
|
||||
|
||||
release:
|
||||
name: "Corteza (${{ matrix.os }})"
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ server-release, client-web-aio-release ]
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ "linux" ]
|
||||
env:
|
||||
ENDPOINT: https://releases.cortezaproject.org/files
|
||||
RELEASE_SFTP_KEY: ${{ secrets.RELEASE_SFTP_KEY }}
|
||||
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
|
||||
steps:
|
||||
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Download"
|
||||
run: |
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-server-${{ env.BUILD_VERSION }}-${{ matrix.os }}-amd64.tar.gz" | \
|
||||
tar -xzmok -C .
|
||||
mv corteza-server dist
|
||||
rm -rf dist/webapp
|
||||
mkdir dist/webapp
|
||||
curl --silent --location "${{ env.RELEASE_BASE_URL }}/corteza-webapp-${{ env.BUILD_VERSION }}.tar.gz" | \
|
||||
tar -xzmok -C dist/webapp
|
||||
- name: "Pack"
|
||||
run: |
|
||||
tar -C dist -czf corteza-${{ env.BUILD_VERSION }}-linux-amd64.tar.gz $(dir dist)
|
||||
- name: "Upload"
|
||||
run: |
|
||||
echo ${{ env.RELEASE_SFTP_KEY }} | base64 -d > .upload-rsa
|
||||
chmod 0400 .upload-rsa
|
||||
echo "put corteza-${{ env.BUILD_VERSION }}-linux-amd64.tar.gz" | \
|
||||
sftp -q -o "StrictHostKeyChecking no" -i .upload-rsa ${{ env.RELEASE_SFTP_URI }}
|
||||
rm -f .upload-rsa
|
||||
if: ${{ !env.ACT }}
|
||||
|
||||
########################################################################################################################
|
||||
########################################################################################################################
|
||||
# Discovery
|
||||
|
||||
aux-server-discovery-test:
|
||||
name: "Discovery Server test"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Placeholder"
|
||||
run: echo "@todo add tests"
|
||||
|
||||
aux-server-discovery-release:
|
||||
name: "Discovery Server release ${{ matrix.os }}"
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- { runsOn: "ubuntu-latest", os: "linux" }
|
||||
- { runsOn: "macos-latest", os: "darwin" }
|
||||
runs-on: ${{ matrix.runsOn }}
|
||||
needs: [ aux-server-discovery-test ]
|
||||
env:
|
||||
BUILD_OS: ${{ matrix.os }}
|
||||
BUILD_VERSION: ${{ format(github.ref, 'refs/tags/', '') }}
|
||||
RELEASE_SFTP_KEY: ${{ secrets.RELEASE_SFTP_KEY }}
|
||||
RELEASE_SFTP_URI: ${{ secrets.RELEASE_SFTP_URI }}
|
||||
steps:
|
||||
- run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: "${{ env.GO_VERSION }}" }
|
||||
- name: "Copy essentials"
|
||||
run: cp *.md DCO LICENSE aux/server-discovery/
|
||||
- name: "Build & release"
|
||||
working-directory: aux/server-discovery/
|
||||
run: make release-clean release
|
||||
- name: "Upload"
|
||||
working-directory: aux/server-discovery/
|
||||
run: make upload
|
||||
if: ${{ !env.ACT }}
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
|
||||
docker-imags:
|
||||
name: "Docker image ${{ matrix.image }}"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- server-release
|
||||
- client-web-aio-release
|
||||
- aux-server-discovery-release
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- { context: "aux/server-discovery", image: "cortezaproject/corteza-server-discovery" }
|
||||
- { context: "client/web", image: "cortezaproject/corteza-webapp" }
|
||||
- { context: "server", image: "cortezaproject/corteza-server" }
|
||||
- { context: ".", image: "cortezaproject/corteza" }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Parse version tag"
|
||||
id: version
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
|
||||
echo "DOCKER_IMAGE_TAG=${TAG}" >> $GITHUB_ENV
|
||||
|
||||
if [[ "$(echo ${TAG} | grep '-')" == "" ]]; then
|
||||
# when releasing patched version (YYYY.MM.PATCH) we
|
||||
# tag alias (YYYY.MM) as well
|
||||
echo "DOCKER_IMAGE_ALIAS=$(echo ${TAG} | cut -d '.' -f -2)" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Build"
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg "VERSION=${{ env.DOCKER_IMAGE_TAG }}" \
|
||||
--tag ${{ matrix.image }}:${{ env.DOCKER_IMAGE_TAG }} \
|
||||
${{ matrix.context }}
|
||||
|
||||
- name: "Login"
|
||||
uses: docker/login-action@v2
|
||||
if: ${{ !env.ACT && env.DOCKER_IMAGE_TAG }}
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: "Push ${{ env.DOCKER_IMAGE_TAG }}"
|
||||
if: ${{ !env.ACT }}
|
||||
run: |
|
||||
docker push \
|
||||
${{ matrix.image }}:${{ env.DOCKER_IMAGE_TAG }}
|
||||
|
||||
- name: "Push ${{ env.DOCKER_IMAGE_ALIAS }}"
|
||||
if: ${{ !env.ACT && env.DOCKER_IMAGE_ALIAS }}
|
||||
run: |
|
||||
docker tag \
|
||||
${{ matrix.image }}:${{ env.DOCKER_IMAGE_TAG }} \
|
||||
${{ matrix.image }}:${{ env.DOCKER_IMAGE_ALIAS }}
|
||||
|
||||
docker push \
|
||||
${{ matrix.image }}:${{ env.DOCKER_IMAGE_ALIAS }}
|
||||
|
||||
26
.github/workflows/stale-issues.yml
vendored
Normal file
26
.github/workflows/stale-issues.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '27 6 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'Stale issue message'
|
||||
stale-pr-message: 'Stale pull request message'
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
Loading…
x
Reference in New Issue
Block a user