Build OTP for Ubuntu 20 (#2) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
env: | |
OTP_RELEASE: 22.0.7 | |
jobs: | |
create_release: | |
runs-on: ubuntu-20.04 | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: release-${{ github.run_id }} | |
release_name: Release ${{ github.run_id }} | |
draft: false | |
prerelease: false | |
build_and_upload: | |
strategy: | |
matrix: | |
platform: [ubuntu-20.04, macos-10.15] | |
wx: [headless, graphical] | |
src: [src, no-src] | |
runs-on: ${{ matrix.platform }} | |
needs: create_release | |
steps: | |
- name: checkout this repo | |
uses: actions/checkout@v2 | |
- name: checkout kerl repo | |
uses: actions/checkout@v2 | |
with: | |
repository: kerl/kerl | |
path: kerl | |
- name: checkout wxwidgets repo | |
if: ${{ matrix.wx == 'graphical' }} | |
uses: actions/checkout@v2 | |
with: | |
repository: wxWidgets/wxWidgets | |
ref: WX_3_0_BRANCH | |
path: wxwidgets | |
- name: Build wxWidgets | |
if: ${{ matrix.wx == 'graphical' }} | |
shell: bash | |
run: | | |
set -ex | |
./build_wxwidgets.bash wxwidgets ~/wx-install | |
- name: Build OTP | |
shell: bash | |
run: | | |
set -ex | |
PATH="${PATH}:${HOME}/wx-install/bin" | |
export KERL_CONFIGURE_DISABLE_APPLICATIONS="megaco eldap snmp mnesia et diameter" | |
kerl/kerl build ${OTP_RELEASE} | |
RELEASE_DIR="R${OTP_RELEASE}" | |
kerl/kerl install ${OTP_RELEASE} ${RELEASE_DIR} | |
[[ $INCLUDE_OTP_SRC == 'no-src' ]] && rm -rf ${RELEASE_DIR}/lib/*/src | |
tar -czf my_release.tar.gz ${RELEASE_DIR}/* | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer | |
INCLUDE_OTP_SRC: ${{ matrix.src }} | |
- name: Upload Release asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./my_release.tar.gz | |
asset_name: otp_${{ env.OTP_RELEASE }}_${{ matrix.platform }}_${{ matrix.wx }}_${{ matrix.src }}.tar.gz | |
asset_content_type: application/gzip | |