Skip to content

Commit

Permalink
Merge pull request #5103 from NipunaMadhushan/master
Browse files Browse the repository at this point in the history
Include installer tests in publish release
  • Loading branch information
NipunaMadhushan authored Dec 6, 2023
2 parents 7855291 + 8beb24b commit 7e61891
Showing 1 changed file with 59 additions and 25 deletions.
84 changes: 59 additions & 25 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
default: ''

permissions:
id-token: write
id-token: write
contents: write

jobs:
Expand All @@ -33,6 +33,7 @@ jobs:
run: |
SHORT_VERSION=$((grep -w 'version' | cut -d= -f2 | cut -d- -f1) < gradle.properties)
DIST_VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)
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
TAGGED_VERSION=$RELEASE_VERSION
Expand All @@ -46,6 +47,7 @@ jobs:
echo "::set-output name=sversion::$SHORT_VERSION"
echo "::set-output name=taggedVersion::$TAGGED_VERSION"
echo "::set-output name=longVersion::$LONG_VERSION"
echo "::set-output name=langversion::$LANG_VERSION"
- name: Pre release depenency version update
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -70,7 +72,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }}
devCentralToken: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}
githubAccessToken: ${{ secrets.GITHUB_TOKEN }}
ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }}
run: |
Expand Down Expand Up @@ -135,8 +137,8 @@ jobs:
echo "::set-output name=branchName::$branchName"
- name: Update Markdown file
run: |
if ${{ github.event.inputs.isPreRelease }} == 'true'; then
echo "" > release_notes.md;
if ${{ github.event.inputs.isPreRelease }} == 'true'; then
echo "" > release_notes.md;
else sed -i 's/{{ version }}/${{ steps.version-set.outputs.taggedVersion }}/g' release_notes.md; sed -i 's/{{ branch }}/${{ steps.retrieve-branch.outputs.branchName }}/g' release_notes.md; fi
- name: Read release notes from file
id: release_notes
Expand Down Expand Up @@ -211,7 +213,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}.zip
asset_path: ballerina/build/distributions/ballerina-${{ steps.version-set.outputs.longVersion }}.zip
asset_content_type: application/octet-stream
- name: Upload zip artifact's Certificate
- name: Upload zip artifact's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -220,7 +222,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}.pem
asset_content_type: application/octet-stream
- name: Upload zip artifact's Signature
- name: Upload zip artifact's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -238,7 +240,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.sversion }}.zip
asset_path: ballerina/build/distributions/ballerina-${{ steps.version-set.outputs.sversion }}.zip
asset_content_type: application/octet-stream
- name: Upload zip without tool artifact's Certificate
- name: Upload zip without tool artifact's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -247,7 +249,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.sversion }}.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.sversion }}.pem
asset_content_type: application/octet-stream
- name: Upload zip without tool artifact's Signature
- name: Upload zip without tool artifact's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -265,7 +267,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.deb
asset_path: installers/linux-deb/target/ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.deb
asset_content_type: application/octet-stream
- name: Upload Linux deb Installer's Certificate
- name: Upload Linux deb Installer's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -274,7 +276,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.deb.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.deb.pem
asset_content_type: application/octet-stream
- name: Upload Linux deb Installer's Signature
- name: Upload Linux deb Installer's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -292,7 +294,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.rpm
asset_path: installers/linux-rpm/rpmbuild/RPMS/x86_64/ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.rpm
asset_content_type: application/octet-stream
- name: Upload Linux rpm Installer's Certificate
- name: Upload Linux rpm Installer's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -301,7 +303,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.rpm.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}-linux-x64.rpm.pem
asset_content_type: application/octet-stream
- name: Upload Linux rpm Installer's Signature
- name: Upload Linux rpm Installer's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -319,7 +321,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-macos.zip
asset_path: ballerina/build/distributions/ballerina-${{ steps.version-set.outputs.longVersion }}-macos.zip
asset_content_type: application/octet-stream
- name: Upload MacOS zip artifact's Certificate
- name: Upload MacOS zip artifact's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -328,7 +330,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-macos.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}-macos.pem
asset_content_type: application/octet-stream
- name: Upload MacOS zip artifact's Signature
- name: Upload MacOS zip artifact's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -346,7 +348,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-macos-arm.zip
asset_path: ballerina/build/distributions/ballerina-${{ steps.version-set.outputs.longVersion }}-macos-arm.zip
asset_content_type: application/octet-stream
- name: Upload MacOS-ARM zip artifact's Certificate
- name: Upload MacOS-ARM zip artifact's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -355,7 +357,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-macos-arm.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}-macos-arm.pem
asset_content_type: application/octet-stream
- name: Upload MacOS-ARM zip artifact's Signature
- name: Upload MacOS-ARM zip artifact's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -373,7 +375,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-windows.zip
asset_path: ballerina/build/distributions/ballerina-${{ steps.version-set.outputs.longVersion }}-windows.zip
asset_content_type: application/octet-stream
- name: Upload Windows zip artifact's Certificate
- name: Upload Windows zip artifact's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -382,7 +384,7 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.longVersion }}-windows.pem
asset_path: ./ballerina-${{ steps.version-set.outputs.longVersion }}-windows.pem
asset_content_type: application/octet-stream
- name: Upload Windows zip artifact's Signature
- name: Upload Windows zip artifact's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand Down Expand Up @@ -427,6 +429,19 @@ jobs:
asset_name: ballerina-${{ steps.version-set.outputs.sversion }}.zip.sha256
asset_path: ballerina-${{ steps.version-set.outputs.sversion }}.zip.sha256
asset_content_type: application/octet-stream
- name: Install Ballerina DEB
run: sudo dpkg -i installers/linux-deb/target/ballerina-*-linux-x64.deb
- name: Update Installer Test Configs
run: |
DISPLAY_TEXT=${{ steps.project-version.outputs.langversion }}
SWAN_LAKE_LATEST_VERSION="swan-lake-"+$DISPLAY_TEXT
perl -pi -e "s/^\s*swan-lake-latest-version-display-text=.*/swan-lake-latest-version-display-text=$DISPLAY_TEXT/" ballerina-test-automation/gradle.properties
perl -pi -e "s/^\s*swan-lake-latest-version=.*/swan-lake-latest-version=$SWAN_LAKE_LATEST_VERSION/" ballerina-test-automation/gradle.properties
- name: Run Installer Tests
working-directory: ./ballerina-test-automation/installer-test
run: ./../gradlew build --stacktrace -scan --console=plain --no-daemon -DballerinaInstalled=true
env:
TEST_MODE_ACTIVE: true
- name: Post release PR
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -438,6 +453,7 @@ jobs:
project-version: ${{ steps.version-set.outputs.longVersion }}
upload-asset-url: ${{ steps.create_release.outputs.upload_url }}
release-version: ${{ steps.version-set.outputs.taggedVersion }}
lang-version: ${{ steps.version-set.outputs.langversion }}

macos-installer-build:
name: MacOS Installer Build
Expand Down Expand Up @@ -490,7 +506,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-macos-x64.pkg
asset_path: installers/mac/target/pkg/ballerina-${{ needs.publish-release.outputs.project-version }}-macos-x64.pkg
asset_content_type: application/octet-stream
- name: Upload MacOS installer's Certificate
- name: Upload MacOS installer's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -499,7 +515,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-macos-x64.pkg.pem
asset_path: ./ballerina-${{ needs.publish-release.outputs.project-version }}-macos-x64.pkg.pem
asset_content_type: application/octet-stream
- name: Upload MacOS installer's Signature
- name: Upload MacOS installer's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand Down Expand Up @@ -544,7 +560,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg
asset_path: installers/mac/target/pkg/ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg
asset_content_type: application/octet-stream
- name: Upload MacOS-ARM installer's Certificate
- name: Upload MacOS-ARM installer's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -553,7 +569,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg.pem
asset_path: ./ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg.pem
asset_content_type: application/octet-stream
- name: Upload MacOS-ARM installer's Signature
- name: Upload MacOS-ARM installer's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -562,6 +578,19 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg.sig
asset_path: ./ballerina-${{ needs.publish-release.outputs.project-version }}-macos-arm-x64.pkg.sig
asset_content_type: application/octet-stream
- name: Install Ballerina PKG
run: sudo installer -pkg installers/mac/target/pkg/ballerina-*-macos-x64.pkg -target /
- name: Update Installer Test Configs
run: |
DISPLAY_TEXT=${{ needs.ubuntu-build.outputs.lang-version }}
SWAN_LAKE_LATEST_VERSION="swan-lake-"+$DISPLAY_TEXT
perl -pi -e "s/^\s*swan-lake-latest-version-display-text=.*/swan-lake-latest-version-display-text=$DISPLAY_TEXT/" ballerina-test-automation/gradle.properties
perl -pi -e "s/^\s*swan-lake-latest-version=.*/swan-lake-latest-version=$SWAN_LAKE_LATEST_VERSION/" ballerina-test-automation/gradle.properties
- name: Run Installer Tests
working-directory: ./ballerina-test-automation/installer-test
run: ./../gradlew build --stacktrace -scan --console=plain --no-daemon -DballerinaInstalled=true
env:
TEST_MODE_ACTIVE: true

windows-installer-build:
name: Windows Installer Build
Expand Down Expand Up @@ -624,7 +653,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-windows-x64.msi
asset_path: w\target\msi\ballerina-${{ needs.publish-release.outputs.project-version }}-windows-x64.msi
asset_content_type: application/octet-stream
- name: Upload Windows installer's Certificate
- name: Upload Windows installer's Certificate
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -633,7 +662,7 @@ jobs:
asset_name: ballerina-${{ needs.publish-release.outputs.project-version }}-windows-x64.msi.pem
asset_path: ./ballerina-${{ needs.publish-release.outputs.project-version }}-windows-x64.msi.pem
asset_content_type: application/octet-stream
- name: Upload Windows installer's Signature
- name: Upload Windows installer's Signature
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand All @@ -645,9 +674,14 @@ jobs:
- name: Install Ballerina msi
run: msiexec /i w\target\msi\ballerina-${{ needs.publish-release.outputs.project-version }}-windows-x64.msi /quiet /qr
shell: cmd
- name: Update Installer Test Configs
run: |
set DISPLAY_TEXT=${{ needs.publish-release.outputs.lang-version }}
set SWAN_LAKE_LATEST_VERSION=swan-lake-%DISPLAY_TEXT%
perl -pi -e "s/^\s*swan-lake-latest-version-display-text=.*/swan-lake-latest-version-display-text=%DISPLAY_TEXT%/" ballerina-test-automation/gradle.properties
perl -pi -e "s/^\s*swan-lake-latest-version=.*/swan-lake-latest-version=%SWAN_LAKE_LATEST_VERSION%/" ballerina-test-automation/gradle.properties
- name: Run Installer Tests
working-directory: .\ballerina-test-automation\installer-test
run: |
$env:Path += ";C:\Program Files\Ballerina\bin"
.\..\gradlew build --stacktrace -scan --console=plain --no-daemon -DballerinaInstalled=true

0 comments on commit 7e61891

Please sign in to comment.