diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33ae6c6..53c570f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,28 +17,29 @@ jobs: runs-on: ubuntu-latest outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} + build_meta: ${{ env.build_meta }} steps: - name: Checkout uses: actions/checkout@v2 - name: Generate release info run: | - cd tools + 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}} + ./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 id: create_release uses: softprops/action-gh-release@v1 with: name: ${{env.release_name}} tag_name: ${{env.release_tag_name}} - body_path: tools/release_message.md + body_path: release_gen/release_message.md - name: Add LICENSE uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: tools/LICENSE + asset_path: release_gen/LICENSE asset_name: LICENSE asset_content_type: text/plain - name: Add build_meta.json @@ -47,10 +48,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: tools/build_meta.json + asset_path: release_gen/build_meta.json asset_name: build_meta.json asset_content_type: application/json - + - 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 }} linux-amd64: runs-on: ubuntu-latest diff --git a/tools/create_release_info.sh b/tools/create_release_info.sh deleted file mode 100755 index 653b6f1..0000000 --- a/tools/create_release_info.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -if [ ! $# -eq 4 ] - then - echo "Usage: ./create_release_info.sh " - echo "" - echo "gitrepo: git repository url to clone" - echo "gitref: the git commit id to pull" - echo "actionsurl: the url pointing to the builder job" - echo "actionsrunnumber: the number of the current build" - exit 1 -fi - -#Pull from git -git clone $1 jcef -cd jcef -git checkout $2 - -#Dump git commit id and suspected url -git rev-parse HEAD | cut -c -7 > ../commit_id.txt #Use short 7-digit commit id -( - sed 's/\.git.*$//' <<< "$1" #Remove .git and everything behind from url - echo "/commits/" - git rev-parse HEAD #Add commit id -) | awk '{print}' ORS='' > ../commit_url.txt #Remove newlines and pipe to file - -#Dump git commit message -git log -1 --pretty=%B > ../commit_message.txt - -#Dump cef version info -(grep -o -P '(?<=CEF_VERSION \").*(?=\")' < CMakeLists.txt) > ../cef_version.txt - -#Build final release information -#Tag -( - echo "release_tag_name=" - echo "jcef-" - cat ../commit_id.txt - echo "+cef-" - cat ../cef_version.txt -) | awk '{print}' ORS='' >> $GITHUB_ENV -echo "" >> $GITHUB_ENV - -#Name -( - echo "release_name=" - echo "JCEF " - cat ../commit_id.txt - echo " + CEF " - cat ../cef_version.txt -) | awk '{print}' ORS='' >> $GITHUB_ENV -echo "" >> $GITHUB_ENV - -#Readme -( - ( - echo "**Update JCEF to [" - cat ../commit_id.txt - echo "](" - cat ../commit_url.txt - echo ")**" - ) | awk '{print}' ORS='' - echo "" - echo "" - echo "Build: [GitHub Actions #$4]($3)" - ( - echo "JCEF version: " - cat ../commit_id.txt - ) | awk '{print}' ORS='' - echo "" - ( - echo "CEF version: " - cat ../cef_version.txt - ) | awk '{print}' ORS='' - echo "" - echo "" - echo "Changes from previous release:" - echo "\`\`\`" - cat ../commit_message.txt - echo "\`\`\`" - echo "**NOTE:** The sources appended below are the sources of this repository, not JCEF. Please refer to the JCEF commit linked above to obtain sources of this build." -) > ../release_message.md - -#Add LICENSE -mv LICENSE.txt ../LICENSE - -#Build build_meta.json -( - echo "{" - echo "\"jcef_repository\": \"$1\", " - echo "\"jcef_commit\": \"" && cat ../commit_id.txt && echo "\", " - echo "\"jcef_commit_long\": \"" && git rev-parse HEAD && echo "\", " - echo "\"jcef_url\": \"" && cat ../commit_url.txt && echo "\", " - echo "\"cef_version\": \"" && cat ../cef_version.txt && echo "\", " - echo "\"actions_url\": \"$3\", " - echo "\"actions_number\": \"$4\", " - echo "\"filename_linux_amd64\": \"linux-amd64.tar.gz\", " - echo "\"filename_linux_i386\": \"linux-i386.tar.gz\", " - echo "\"filename_windows_amd64\": \"windows-amd64.tar.gz\", " - echo "\"filename_windows_i386\": \"windows-i386.tar.gz\", " - echo "\"filename_macosx_amd64\": \"macosx-amd64.tar.gz\", " - echo "\"filename_macosx_arm64\": \"macosx-arm64.tar.gz\"" - echo "}" -) | awk '{print}' ORS='' > ../build_meta.json - -#Cleanup -cd .. -rm *.txt -rm -rf jcef