Updated save-stats.sh #583
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: Nightly | |
on: | |
workflow_dispatch: | |
inputs: | |
build-dependent: | |
description: 'Should build dependent repositories? (true/false)' | |
required: false | |
default: false | |
push: | |
branches: | |
- 'master' | |
workflow_call: | |
secrets: | |
WORKFLOW_ACCESS_TOKEN: | |
required: true | |
ACTIONS_READ_ACCESS_TOKEN: | |
required: true | |
schedule: | |
- cron: "42 23 31 12 *" | |
env: | |
REPOSITORY_NAME: ${{ github.event.repository.name }} | |
PROJECT_NAME: 'openponk-${{ github.event.repository.name }}' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: 'nightly' | |
cache-name: zip-cache | |
RUN_ID: ${{ github.run_id }} | |
PHARO_VERSION: 11 | |
jobs: | |
build-win: | |
runs-on: windows-latest | |
env: | |
PLATFORM: win | |
name: 'Build Windows' | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Load SmalltalkCI environment | |
uses: hpi-swa/[email protected] | |
id: smalltalkci | |
with: | |
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }} | |
- name: Prepare scripts directory | |
run: md -Force .github/scripts | |
- name: Download Pharo preLoad script | |
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st | |
- name: Download Pharo postLoad script | |
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st | |
- name: Prepare image and test | |
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }} | |
shell: bash | |
timeout-minutes: 20 | |
- name: Download zip script | |
run: curl -o .github/scripts/build-win.ps1 https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-win.ps1 | |
- name: Download common README content | |
run: curl -o .github/scripts/readmecommon.txt https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/readmecommon.txt | |
- name: Create zip | |
run: .github/scripts/build-win.ps1 | |
env: | |
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }} | |
- name: Cache zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
build-linux: | |
runs-on: ubuntu-latest | |
env: | |
PLATFORM: linux | |
name: 'Build Linux' | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Load SmalltalkCI environment | |
uses: hpi-swa/[email protected] | |
id: smalltalkci | |
with: | |
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }} | |
- name: Prepare scripts directory | |
run: mkdir -p .github/scripts | |
- name: Download Pharo preLoad script | |
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st | |
- name: Download Pharo postLoad script | |
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st | |
- name: Download zip script | |
run: curl -o .github/scripts/build-linux.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-linux.sh | |
- name: Prepare image and test | |
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }} | |
shell: bash | |
timeout-minutes: 12 | |
- name: Download common README content | |
run: curl -o .github/scripts/readmecommon.txt https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/readmecommon.txt | |
- name: Prepare zip script | |
run: chmod u+x .github/scripts/build-linux.sh | |
- name: Create zip | |
run: .github/scripts/build-linux.sh | |
env: | |
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }} | |
- name: Cache zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
build-mac: | |
runs-on: macos-latest | |
env: | |
PLATFORM: mac | |
name: 'Build Mac' | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Load SmalltalkCI environment | |
uses: hpi-swa/[email protected] | |
id: smalltalkci | |
with: | |
smalltalk-image: Pharo64-${{ env.PHARO_VERSION }} | |
- name: Prepare scripts directory | |
run: mkdir -p .github/scripts | |
- name: Download Pharo preLoad script | |
run: curl -o .github/scripts/preLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/preLoad.st | |
- name: Download Pharo postLoad script | |
run: curl -o .github/scripts/postLoad.st https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/postLoad.st | |
- name: Prepare image and test | |
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }} | |
shell: bash | |
timeout-minutes: 12 | |
- name: Download zip script | |
run: curl -o .github/scripts/build-mac.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/build-mac.sh | |
- name: Download common README content | |
run: curl -o .github/scripts/readmecommon.txt https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/readmecommon.txt | |
- name: Prepare zip script | |
run: chmod u+x .github/scripts/build-mac.sh | |
- name: Create zip | |
run: .github/scripts/build-mac.sh | |
env: | |
ACTIONS_READ_ACCESS_TOKEN: ${{ secrets.ACTIONS_READ_ACCESS_TOKEN }} | |
- name: Cache Intel zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Cache ARM zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-ARM-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-ARM-${{ env.VERSION }}.zip | |
check-linux-cache: | |
needs: build-linux | |
runs-on: ubuntu-latest | |
name: 'Check Linux zip is created' | |
env: | |
PLATFORM: linux | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Fail on cache miss | |
if: steps.get-zip.outputs.cache-hit != 'true' | |
run: exit 1 | |
check-mac-intel-cache: | |
needs: build-mac | |
runs-on: macos-latest | |
name: 'Check Mac Intel zip is created' | |
env: | |
PLATFORM: mac | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Fail on cache miss | |
if: steps.get-zip.outputs.cache-hit != 'true' | |
run: exit 1 | |
check-mac-arm-cache: | |
needs: build-mac | |
runs-on: macos-latest | |
name: 'Check Mac ARM zip is created' | |
env: | |
PLATFORM: mac-ARM | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Fail on cache miss | |
if: steps.get-zip.outputs.cache-hit != 'true' | |
run: exit 1 | |
check-win-cache: | |
needs: build-win | |
runs-on: windows-latest | |
name: 'Check Windows zip is created' | |
env: | |
PLATFORM: win | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Fail on cache miss | |
if: steps.get-zip.outputs.cache-hit != 'true' | |
run: exit 1 | |
save-stats: | |
needs: [check-win-cache, check-linux-cache, check-mac-intel-cache, check-mac-arm-cache] | |
runs-on: ubuntu-latest | |
name: 'Save dl stats of previous build' | |
env: | |
PLATFORM: linux | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Prepare scripts directory | |
run: mkdir -p .github/scripts | |
- name: Download save stats script | |
run: curl -o .github/scripts/save-stats.sh https://raw.githubusercontent.com/openponk/plugins/master/.github/scripts/save-stats.sh | |
- name: Prepare save stats script | |
run: chmod u+x .github/scripts/save-stats.sh | |
- name: Save dl stats of last nightly build | |
run: .github/scripts/save-stats.sh | |
create-release: | |
needs: save-stats | |
runs-on: ubuntu-latest | |
name: 'Re-create release' | |
env: | |
PLATFORM: linux | |
steps: | |
- name: Re-create release | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "nightly" | |
prerelease: true | |
title: "nightly" | |
upload-win-zip: | |
needs: create-release | |
runs-on: windows-latest | |
name: 'Upload Windows zip' | |
env: | |
PLATFORM: win | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Get Release by Tag | |
id: get_release_by_tag | |
uses: jonfriesen/[email protected] | |
with: | |
tag_name: nightly | |
- name: Upload zip | |
id: upload-zip | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }} | |
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_content_type: application/zip | |
upload-linux-zip: | |
needs: create-release | |
runs-on: ubuntu-latest | |
name: 'Upload Linux zip' | |
env: | |
PLATFORM: linux | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Get Release by Tag | |
id: get_release_by_tag | |
uses: jonfriesen/[email protected] | |
with: | |
tag_name: nightly | |
- name: Upload zip | |
id: upload-zip | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }} | |
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_content_type: application/zip | |
upload-mac-intel-zip: | |
needs: create-release | |
runs-on: macos-latest | |
name: 'Upload Mac Intel zip' | |
env: | |
PLATFORM: mac | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Get Release by Tag | |
id: get_release_by_tag | |
uses: jonfriesen/[email protected] | |
with: | |
tag_name: nightly | |
- name: Upload zip | |
id: upload-zip | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }} | |
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_content_type: application/zip | |
upload-mac-arm-zip: | |
needs: create-release | |
runs-on: macos-latest | |
name: 'Upload Mac ARM zip' | |
env: | |
PLATFORM: mac-ARM | |
steps: | |
- name: Get zip from cache | |
id: get-zip | |
uses: actions/cache/[email protected] | |
with: | |
path: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
key: ${{ github.run_id }}-${{ github.run_number }}_${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
- name: Get Release by Tag | |
id: get_release_by_tag | |
uses: jonfriesen/[email protected] | |
with: | |
tag_name: nightly | |
- name: Upload zip | |
id: upload-zip | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release_by_tag.outputs.upload_url }} | |
asset_path: ./${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_name: ${{ env.PROJECT_NAME }}-${{ env.PLATFORM }}-${{ env.VERSION }}.zip | |
asset_content_type: application/zip | |
create-dependent-matrix: | |
needs: [create-release] | |
runs-on: ubuntu-latest | |
name: 'Find dependent repositories' | |
if: ${{ github.event_name == 'push' || contains(github.event.inputs.build-dependent || false, 'true') }} | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Check list of repositories exists | |
id: check-file | |
run: test -f ./.github/dependent-repositories.txt || exit 1 | |
- name: Create dependent build matrix | |
id: set-matrix | |
run: echo "::set-output name=matrix::`cat ./.github/dependent-repositories.txt | tr -d " \t\n\r"`" | |
build-dependent: | |
needs: [create-dependent-matrix] | |
runs-on: ubuntu-latest | |
name: 'Build dependent' | |
if: ${{ contains(needs.create-dependent-matrix.outputs.matrix, '/') }} | |
strategy: | |
matrix: ${{fromJson(needs.create-dependent-matrix.outputs.matrix)}} | |
steps: | |
- name: Start ${{ matrix.repository }} build | |
uses: benc-uk/[email protected] | |
with: | |
workflow: Nightly | |
repo: ${{ matrix.repository }} | |
ref: ${{ matrix.branch }} | |
token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }} | |
inputs: '{ "build-dependent": "${{ matrix.build-dependent }}" }' |