build-all #15
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: build-all | |
on: | |
workflow_dispatch: | |
inputs: | |
repo: | |
description: 'Git repository to clone' | |
required: true | |
default: 'https://bitbucket.org/chromiumembedded/java-cef.git' | |
ref: | |
description: 'Git commit id to checkout' | |
required: true | |
default: 'master' | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
release_tag_name: ${{ env.release_tag_name }} | |
build_meta: ${{ env.build_meta }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Generate release info | |
run: | | |
cd release_gen | |
chmod +x create_release_info.sh | |
./create_release_info.sh ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} ${{github.run_number}} ${{github.repository}} | |
- name: Create Release | |
run: | | |
gh release create ${{env.release_tag_name}} --title "${{env.release_name}}" --notes-file release_gen/release_message.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add LICENSE | |
run: | | |
gh release upload ${{env.release_tag_name}} release_gen/LICENSE | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add build_meta.json | |
run: | | |
gh release upload ${{env.release_tag_name}} release_gen/build_meta.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Announce build_meta.json download url to other jobs | |
run: | | |
cd release_gen | |
chmod +x announce_build_meta.sh | |
./announce_build_meta.sh ${{ github.repository }} | |
build-linux-amd64: | |
runs-on: ubuntu-latest | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Build | |
run: | | |
chmod +x compile_linux.sh | |
./compile_linux.sh amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
mv out/binary_distrib.tar.gz out/linux-amd64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-amd64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-linux-arm64: | |
runs-on: ubuntu-latest | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Build | |
run: | | |
chmod +x compile_linux.sh | |
./compile_linux.sh arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
mv out/binary_distrib.tar.gz out/linux-arm64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-arm64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-linux-arm: | |
runs-on: ubuntu-latest | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Build | |
run: | | |
chmod +x compile_linux.sh | |
./compile_linux.sh arm/v6 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
mv out/binary_distrib.tar.gz out/linux-arm.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/linux-arm.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-windows-amd64: | |
runs-on: windows-2022 | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Build | |
shell: cmd | |
run: | | |
compile_windows.bat amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
move out/binary_distrib.tar.gz out/windows-amd64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-amd64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-windows-i386: | |
runs-on: windows-2022 | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Build | |
shell: cmd | |
run: | | |
compile_windows.bat 386 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
move out/binary_distrib.tar.gz out/windows-i386.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-i386.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-windows-arm64: | |
runs-on: windows-2022 | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Build | |
shell: cmd | |
run: | | |
compile_windows.bat arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} | |
- name: Export distribution | |
run: | | |
move out/binary_distrib.tar.gz out/windows-arm64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/windows-arm64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-macosx-amd64: | |
runs-on: macos-12 | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Setup environment | |
run: | | |
chmod +x scripts/install_macos_dependencies.sh | |
./scripts/install_macos_dependencies.sh | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.11' | |
- name: Install Apple certificate | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} | |
run: | | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
- | |
name: Build | |
run: | | |
chmod +x compile_macosx.sh | |
./compile_macosx.sh amd64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} "${{ secrets.APPLE_BUILD_CERTIFICATE_NAME }}" ${{ secrets.APPLE_TEAM_NAME }} ${{ secrets.APPLE_API_ID }} ${{ secrets.APPLE_API_PASS }} | |
- name: Clean up keychain | |
if: ${{ always() }} | |
run: | | |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db | |
rm -rf "${HOME}/private_keys" | |
- name: Export distribution | |
run: | | |
mv out/binary_distrib.tar.gz out/macosx-amd64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/macosx-amd64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Export javadoc | |
run: | | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/javadoc.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-macosx-arm64: | |
runs-on: macos-12 | |
needs: create-release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- | |
name: Setup environment | |
run: | | |
chmod +x scripts/install_macos_dependencies.sh | |
./scripts/install_macos_dependencies.sh | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.11' | |
- name: Install Apple certificate | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} | |
run: | | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
- | |
name: Build | |
run: | | |
chmod +x compile_macosx.sh | |
./compile_macosx.sh arm64 Release ${{ github.event.inputs.repo }} ${{ github.event.inputs.ref }} "${{ secrets.APPLE_BUILD_CERTIFICATE_NAME }}" ${{ secrets.APPLE_TEAM_NAME }} ${{ secrets.APPLE_API_ID }} ${{ secrets.APPLE_API_PASS }} | |
- name: Clean up keychain | |
if: ${{ always() }} | |
run: | | |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db | |
rm -rf "${HOME}/private_keys" | |
- name: Export distribution | |
run: | | |
mv out/binary_distrib.tar.gz out/macosx-arm64.tar.gz | |
gh release upload ${{needs.create-release.outputs.release_tag_name}} out/macosx-arm64.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |