Skip to content

Commit

Permalink
workflow debug 1
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 6, 2023
1 parent 64c85cd commit f9c6c15
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 186 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/save-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ timestamp := DateAndTime now asString.
filename := ((timestamp first: 19) copyReplaceAll: ':' with: '')
, '.csv'.
Transcript show: 'Uploading stats... '.
\"Transcript show: 'Uploading stats... '.
putResponse := ZnClient new
url:
'https://api.github.com/repos/openponk/$REPOSITORY_NAME/contents/'
Expand Down Expand Up @@ -86,6 +86,6 @@ Transcript show: 'Checking upload went ok... '.
' If this is the first build of this repository, manually create branch named dls (possibly with no files). This is whole body of response: '
<< putResponse entity contents ] ]) ].
Transcript show: 'Finished... '.
\"
^ 'Uploaded ' , downloads asString , ' download count'
"
221 changes: 37 additions & 184 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,60 +56,6 @@ jobs:
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-11
- name: Prepare image and test
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 12
- name: Create zip
run: chmod u+x .github/scripts/build-mac.sh; ./.github/scripts/build-mac.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-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-11
- name: Prepare image and test
run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 20
- 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

check-linux-cache:
needs: build-linux
runs-on: ubuntu-latest
Expand All @@ -127,43 +73,26 @@ jobs:
if: steps.get-zip.outputs.cache-hit != 'true'
run: exit 1

check-mac-cache:
needs: build-mac
runs-on: macos-latest
name: 'Check Mac 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-win-cache:
needs: build-win
runs-on: windows-latest
name: 'Check Windows zip is created'
env:
PLATFORM: win
save-statsa:
needs: [check-linux-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: Fail on cache miss
if: steps.get-zip.outputs.cache-hit != 'true'
run: exit 1

- name: Save dl stats of previous build
run: chmod u+x .github/scripts/save-stats.sh; ./.github/scripts/save-stats.sh

save-stats:
needs: [check-linux-cache, check-mac-cache, check-win-cache]
save-statsb:
needs: [check-linux-cache]
runs-on: ubuntu-latest
name: 'Save dl stats of previous build'
env:
Expand All @@ -180,133 +109,57 @@ jobs:
- name: Save dl stats of previous build
run: chmod u+x .github/scripts/save-stats.sh; ./.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-linux-zip:
needs: create-release
save-statsc:
needs: [check-linux-cache]
runs-on: ubuntu-latest
name: 'Upload Linux zip'
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: 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
- name: Save dl stats of previous build
run: chmod u+x .github/scripts/save-stats.sh; ./.github/scripts/save-stats.sh

upload-mac-zip:
needs: create-release
runs-on: macos-latest
name: 'Upload Mac zip'
save-statsd:
needs: [check-linux-cache]
runs-on: ubuntu-latest
name: 'Save dl stats of previous build'
env:
PLATFORM: mac
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: 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
- name: Save dl stats of previous build
run: chmod u+x .github/scripts/save-stats.sh; ./.github/scripts/save-stats.sh

upload-win-zip:
needs: create-release
runs-on: windows-latest
name: 'Upload Windows zip'
save-statse:
needs: [check-linux-cache]
runs-on: ubuntu-latest
name: 'Save dl stats of previous build'
env:
PLATFORM: win
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: 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"`"
- name: Save dl stats of previous build
run: chmod u+x .github/scripts/save-stats.sh; ./.github/scripts/save-stats.sh

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 }}" }'

0 comments on commit f9c6c15

Please sign in to comment.