Skip to content

Commit

Permalink
Merge pull request #5119 from keizer619/master
Browse files Browse the repository at this point in the history
Include daily build for editor builds
  • Loading branch information
keizer619 authored Dec 15, 2023
2 parents cc9d864 + 0b81de9 commit 59e327e
Showing 1 changed file with 142 additions and 0 deletions.
142 changes: 142 additions & 0 deletions .github/workflows/daily-build-editor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: Daily build editor

on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # 07:30 in LK time (GMT+5:30)

jobs:
ubuntu-build:

runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'

steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.0.7'
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.22.1'
- name: Checkout Lang Repository
uses: actions/checkout@v3
with:
repository: ballerina-platform/ballerina-lang
ref: worker_change
path: ballerina-lang

- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
TEST_MODE_ACTIVE: true
run: |
cd ballerina-lang
./gradlew clean build --stacktrace --scan -x test --console=plain --no-daemon --continue publishToMavenLocal
cd ..
- name: Checkout Dev Tools Repository
uses: actions/checkout@v3
with:
repository: ballerina-platform/ballerina-dev-tools
ref: worker_change
path: ballerina-dev-tools
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
TEST_MODE_ACTIVE: true
run: |
cd ballerina-dev-tools
sed -i 's/ballerinaLangVersion=[0-9]\+\(\.[0-9]\+\)\{2\}-[0-9]\+-[0-9a-f]\+/ballerinaLangVersion=SNAPSHOT/' gradle.properties
./gradlew clean build --stacktrace --scan -x test --console=plain --no-daemon --continue publishToMavenLocal
cd ..
- name: Checkout Distribution Repository
uses: actions/checkout@v3
with:
ref: worker_change
repository: ballerina-platform/ballerina-distribution
path: ballerina-distribution
- name: Get daily docker version
id: version
run: echo "::set-output name=version::$(date +'%Y-%m-%d')"
- name: Get project version
id: project-version
run: |
cd ballerina-distribution
SHORT_VERSION=$((grep -w "version" | cut -d= -f2 | cut -d- -f1 | xargs) < gradle.properties)
DIST_VERSION=$((grep -w "version" | cut -d= -f2 | xargs) < gradle.properties)
LANG_VERSION=$((grep -w "ballerinaLangVersion" | cut -d= -f2 | cut -d- -f1 | xargs) < gradle.properties)
CODE_NAME=$((grep -w 'codeName' | cut -d= -f2) < gradle.properties)
RELEASE_VERSION=$DIST_VERSION-$CODE_NAME
echo "::set-output name=version::$RELEASE_VERSION"
echo "::set-output name=sversion::$SHORT_VERSION"
echo "::set-output name=langversion::$LANG_VERSION"
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
TEST_MODE_ACTIVE: true
run: |
cd ballerina-distribution
sed -i 's/ballerinaLangVersion=[0-9]\+\(\.[0-9]\+\)\{2\}-[0-9]\+-[0-9a-f]\+/ballerinaLangVersion=SNAPSHOT/' gradle.properties
sed -i 's/devToolsVersion=[0-9]\+\(\.[0-9]\+\)\{2\}-[0-9]\+-[0-9a-f]\+/devToolsVersion=SNAPSHOT/' gradle.properties
./gradlew clean build --stacktrace --scan -x test --console=plain --no-daemon --continue -x project-api-tests:test
- name: Create linux-deb
id: run_installers_deb
run: |
cd ballerina-distribution/installers/linux-deb
./build-ballerina-linux-deb-x64.sh -v ${{ steps.project-version.outputs.version }} -p ./../../ballerina/build/distributions
echo "Created linux-deb successfully"
- name: Create linux-rpm
id: run_installers_rpm
run: |
cd ballerina-distribution/installers/linux-rpm
./build-ballerina-linux-rpm-x64.sh -v ${{ steps.project-version.outputs.version }} -p ./../../ballerina/build/distributions
echo "Created linux-rpm successfully"
- name: Archive Ballerina ZIP
uses: actions/upload-artifact@v2
with:
name: Ballerina ZIP
path: ballerina-distribution/ballerina/build/distributions/ballerina-*-swan-lake.zip
- name: Archive Ballerina Short Name ZIP
uses: actions/upload-artifact@v2
with:
name: Ballerina Short Name ZIP
path: ballerina-distribution/ballerina/build/distributions/ballerina-${{ steps.project-version.outputs.sversion }}.zip
- name: Archive Linux deb
uses: actions/upload-artifact@v2
with:
name: Linux Installer deb
path: ballerina-distribution/installers/linux-deb/target/ballerina-*-linux-x64.deb
- name: Archive Linux rpm
uses: actions/upload-artifact@v2
with:
name: Linux Installer rpm
path: ballerina-distribution/installers/linux-rpm/rpmbuild/RPMS/x86_64/ballerina-*-linux-x64.rpm
- name: Archive MacOS Installer ZIP
uses: actions/upload-artifact@v2
with:
name: MacOS Installer ZIP
path: ballerina-distribution/ballerina/build/distributions/ballerina-*-macos.zip
- name: Archive MacOS-ARM Installer ZIP
uses: actions/upload-artifact@v2
with:
name: MacOS-ARM Installer ZIP
path: ballerina-distribution/ballerina/build/distributions/ballerina-*-macos-arm.zip
- name: Archive Windows Installer ZIP
uses: actions/upload-artifact@v2
with:
name: Windows Installer ZIP
path: ballerina-distribution/ballerina/build/distributions/ballerina-*-windows.zip

0 comments on commit 59e327e

Please sign in to comment.