Skip to content

Build & Release

Build & Release #19

Workflow file for this run

name: Build & Release
on:
workflow_dispatch:
env:
GOPRIVATE: "github.com/dbnet-io/*,github.com/slingdata-io/*"
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
SSH_SERVER_URL: ${{ secrets.SSH_SERVER_URL }}
RUDDERSTACK_URL: ${{ secrets.RUDDERSTACK_URL }}
jobs:
build-frontend:
timeout-minutes: 15
# runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Set up Node 16
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Cache NPM
id: cache-npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build frontend
run: |
npm install -g yarn
bash scripts/build.frontend.sh
- uses: actions/upload-artifact@v2
with:
name: webapp-dist
path: server/app
release-brew:
timeout-minutes: 20
runs-on: [self-hosted, macOS, ARM64]
# runs-on: macos-latest
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.mac.yaml
release-linux:
runs-on: ubuntu-20.04
# runs-on: [self-hosted, Linux]
timeout-minutes: 20
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Login docker
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u dbnetio --password-stdin
- name: Configure git for private modules
run: git config --global url."https://flarco:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
- name: Run GoReleaser
# uses: flarco/goreleaser-action@master
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.linux.yaml
release-windows:
runs-on: windows-latest
# runs-on: [self-hosted, Windows]
timeout-minutes: 20
needs: [build-frontend]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- uses: actions/download-artifact@v2
with:
name: webapp-dist
path: server/app
- name: Configure git for private modules
run: git config --global url."https://flarco:$env:[email protected]".insteadOf "https://github.com"
- name: Run GoReleaser
# uses: flarco/goreleaser-action@master
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate -f .goreleaser.windows.yaml
deploy-staging:
timeout-minutes: 5
runs-on: self-hosted
needs: [release-linux]
steps:
- uses: actions/checkout@v2
- name: Deploy to Staging
run: bash scripts/deploy.staging.sh