Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21700/21836: Adds automated version bump for amalgam-lang-ts; turns off CTest concurrency; fixes WASM debug build naming issue #275

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,90 @@ jobs:
makeLatest: legacy
artifacts: amalgam-*/amalgam-*.tar.gz
artifactContentType: application/gzip

create-amalgam-lang-ts-branch:
if: inputs.build-type == 'release'
needs: ['release']
uses: "howsoai/.github/.github/workflows/create-branch.yml@main"
secrets: inherit
with:
branch: 'amalgam-${{ inputs.version }}-update'
repo: 'howsoai/amalgam-lang-ts'

update-amalgam-lang-ts:
if: inputs.build-type == 'release'
needs: ['create-amalgam-lang-ts-branch']
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
steps:

- uses: actions/checkout@v4
with:
token: ${{ secrets.HOWSOAI_WORKFLOW_AUTOMATION_TOKEN }}
ref: 'amalgam-${{ inputs.version }}-update'
repository: 'howsoai/amalgam-lang-ts'

- name: Clean out src/webassembly
run: |
rm -rf ./src/webassembly
mkdir -p ./src/webassembly
touch ./src/webassembly/version.json

- name: Download Release WASM
uses: actions/download-artifact@v4
with:
name: amalgam-${{ inputs.version }}-release-unknown-wasm64

- name: Extract Release WASM
run: |
tar -xvf ./amalgam-${{ inputs.version }}-wasm64.tar.gz -C ./src/webassembly
rm -rf ./amalgam-${{ inputs.version }}-wasm64.tar.gz

- name: Download Debug WASM
uses: actions/download-artifact@v4
with:
name: amalgam-${{ inputs.version }}-debug-unknown-wasm64

- name: Extract Debug WASM
run: |
# These will be located in src/webassembly/debug
mkdir -p ./src/webassembly/debug
tar -xvf ./amalgam-${{ inputs.version }}-wasm64-debug.tar.gz -C ./src/webassembly/debug
rm -rf ./amalgam-${{ inputs.version }}-wasm64.tar.gz

- name: Set version.json
run: |
cd src/webassembly && ls -l
echo '{}' | jq --arg version "${{ inputs.version }}" '.dependencies.amalgam = $version' > version.json
cat version.json

- name: Commit and push changes
run: |
git pull
if [ -n "$(git status --porcelain)" ]; then
git config user.name "howso-automation"
git config user.email "support@howso.com"
git add --all :/
git commit -m "Automated Amalgam version bump"
git push
else
echo "No changes detected in the repository."
exit 1
fi

create-amalgam-lang-ts-pr:
if: inputs.build-type == 'release'
needs: ['update-amalgam-lang-ts']
uses: "howsoai/.github/.github/workflows/create-pr.yml@main"
secrets: inherit
permissions:
contents: write
pull-requests: write
with:
branch: 'amalgam-${{ inputs.version }}-update'
repo: 'howsoai/amalgam-lang-ts'
title: 'Automated version update: Amalgam ${{ inputs.version }}'
body: 'This action was performed by a bot. Please review carefully.'
5 changes: 5 additions & 0 deletions build/cmake/create_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${AMALGAM_VERSION_FULL}")
if(NOT IS_WASM)
# Non-WASM builds
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${OSv2}-${ARCH}")
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
# WASM debug builds
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARCH}-debug")
else()
# WASM release builds
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARCH}")
endif()
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_INSTALL_PREFIX}/../../package")
Expand Down
2 changes: 2 additions & 0 deletions build/cmake/create_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ enable_testing()

# CTest args:
set(CMAKE_CTEST_ARGUMENTS "-j" "--schedule-random" "--output-on-failure" "--extra-verbose" "--output-log" "${CMAKE_SOURCE_DIR}/out/test/all_tests.log")
# Ensure tests are not run in parallel
set(CTEST_PARALLEL_LEVEL 1)

# Not all tests can be run on all platforms:
if(IS_WASM)
Expand Down
Loading