Skip to content

Commit

Permalink
Merge pull request #213 from katalon-studio/master
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
quidl authored Jun 13, 2024
2 parents 96deae5 + 9fda738 commit 92bcec9
Show file tree
Hide file tree
Showing 24 changed files with 8,881 additions and 10,593 deletions.
98 changes: 77 additions & 21 deletions .github/workflows/package_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Package Agent
branches:
- master
- release
- asdasd

permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout
Expand All @@ -19,114 +21,168 @@ jobs:
- macos-latest
- windows-latest
node-version:
- 14.x
- 20.9.0
steps:
- name: Checkout code
uses: actions/[email protected]
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache
id: cache-packages
uses: actions/cache@v2.1.4
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

- name: Install packages
if: steps.cache-packages.outputs.cache-hit != 'true'
run: npm ci

- name: Build with Node.js ${{ matrix.node-version }} on ${{ runner.os }}
env:
CI: true
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
npm run buildLinux --if-present
chmod +x bin/cli-linux-x64 *.sh
ls -l bin
npm run build
node --experimental-sea-config sea-config.json
cp $(command -v node) agent
npx postject agent NODE_SEA_BLOB agent.blob \
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
chmod +x agent
mkdir bin
cp agent bin/cli-linux-x64
npm run afterbuild
ls -al bin
- name: Build with Node.js ${{ matrix.node-version }} on ${{ runner.os }}
env:
CI: true
if: ${{ matrix.os == 'macos-latest' }}
run: |
npm run buildMacos --if-present
chmod +x bin/cli-macos-x64 *.sh
ls -l bin
npm run build
node --experimental-sea-config sea-config.json
cp $(command -v node) agent
codesign --remove-signature agent
npx postject agent NODE_SEA_BLOB agent.blob \
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
--macho-segment-name NODE_SEA
# codesign --sign - agent
mkdir bin
chmod +x agent
cp agent bin/cli-macos-x64
npm run afterbuild
ls -al bin
- name: Build with Node.js ${{ matrix.node-version }} on ${{ runner.os }}
env:
CI: true
if: ${{ matrix.os == 'windows-latest' }}
run: npm run buildWin --if-present
run: |
npm run build
node --experimental-sea-config sea-config.json
node -e "require('fs').copyFileSync(process.execPath, 'agent.exe')"
# $signtool = "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe"
# $signtool remove /s agent.exe
npx postject agent.exe NODE_SEA_BLOB agent.blob `
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
# $signtool sign /fd SHA256 agent.exe
# chmod +x agent
md bin -ea 0
cp agent.exe bin/cli-win-x64.exe
cp agent.exe bin/cli-win-x86.exe
npm run afterbuild
# ls -al
- name: Set BUILD_VERSION environment variable
run: echo "BUILD_VERSION=$(node -p "require('./package').version")" >> $GITHUB_ENV
shell: bash

- name: Upload Windows x64 artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'windows-latest' }}
with:
name: katalon-agent-win-x64-${{ env.BUILD_VERSION }}
path: |
bin/cli-win-x64.exe
bin/nssm.exe
bin/*.bat
- name: Upload Windows x86 artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'windows-latest' }}
with:
name: katalon-agent-win-x86-${{ env.BUILD_VERSION }}
path: |
bin/cli-win-x86.exe
bin/nssm.exe
bin/*.bat
- name: Upload Linux x64 artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: katalon-agent-linux-x64-${{ env.BUILD_VERSION }}
path: |
bin/cli-linux-x64
bin/*.sh
- name: Upload MacOS x64 artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'macos-latest' }}
with:
name: katalon-agent-macos-x64-${{ env.BUILD_VERSION }}
path: |
bin/cli-macos-x64
bin/start.sh
deploy:
name: Deploy staging cloud agent
environment: staging
needs: build
strategy:
matrix:
node-version:
- 10.x
- 20.9.0
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm install --only dev

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/katalon-github-oidc-federation
role-session-name: github-actions
aws-region: ${{ vars.AWS_REGION }}
mask-aws-account-id: 'no'

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: .

- name: Add execute permission to downloaded artifacts
run: chmod +x katalon-agent-linux-*/* katalon-agent-macos-*/*

- name: Set BUILD_VERSION environment variable
run: echo "BUILD_VERSION=$(node -p "require('./package').version")" >> $GITHUB_ENV

- name: Package artifacts
env:
GZIP: -9
Expand All @@ -143,4 +199,4 @@ jobs:
tar cvzf ../packages/katalon-agent-linux-x64-$BUILD_VERSION.tar.gz *
cd ..
ls -laR
aws s3 sync packages/ s3://katalon-testops-agent-beta/$BUILD_VERSION --acl public-read
aws s3 sync packages/ s3://katalon-testops-agent-beta/$BUILD_VERSION --acl public-read
Loading

0 comments on commit 92bcec9

Please sign in to comment.