Nightly Release #418
This file contains hidden or 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 Release | |
| on: | |
| schedule: | |
| # Run every day at 01:00 UTC | |
| - cron: "0 1 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check_commits: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has_commits: ${{ steps.check_commits.outputs.has_commits }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: "main" | |
| - name: Check for commits from yesterday | |
| id: check_commits | |
| run: | | |
| # Get yesterday's date in YYYY-MM-DD format | |
| YESTERDAY=$(date -d "yesterday" +%Y-%m-%d) | |
| echo "Checking for commits from: $YESTERDAY" | |
| # Check if there were any commits yesterday | |
| COMMIT_COUNT=$(git log --oneline --since="$YESTERDAY 00:00:00" --until="$YESTERDAY 23:59:59" | wc -l) | |
| echo "Found $COMMIT_COUNT commits from yesterday" | |
| if [ $COMMIT_COUNT -gt 0 ]; then | |
| echo "has_commits=true" >> $GITHUB_OUTPUT | |
| echo "✅ Found $COMMIT_COUNT commits from yesterday - continuing workflow" | |
| else | |
| echo "has_commits=false" >> $GITHUB_OUTPUT | |
| echo "❌ No commits found from yesterday - skipping remaining steps" | |
| echo "::notice::❌ No commits found from yesterday - skipping remaining steps" | |
| fi | |
| build: | |
| if: ${{ needs.check_commits.outputs.has_commits == 'true' }} | |
| needs: [check_commits] | |
| uses: ./.github/workflows/reusable-build.yml | |
| with: | |
| is_release: false | |
| retention_days: 40 | |
| generate-nightly-json: | |
| runs-on: ubuntu-24.04 | |
| if: ${{ needs.check_commits.outputs.has_commits == 'true' }} | |
| environment: tags | |
| needs: [build, check_commits] | |
| steps: | |
| - name: Checkout revive | |
| uses: actions/checkout@v6 | |
| with: | |
| path: revive | |
| - uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.REVIVE_JSON_APP_ID }} | |
| private-key: ${{ secrets.REVIVE_JSON_APP_KEY }} | |
| owner: paritytech | |
| repositories: resolc-bin | |
| - name: Checkout resolc-bin | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: paritytech/resolc-bin | |
| path: resolc-bin | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| merge-multiple: true | |
| path: bins | |
| - name: Generate JSON | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APP_NAME: "paritytech-revive-json" | |
| run: | | |
| # Rename resolc-web_js_* output keys to resolc-web.js_* expected by the script. | |
| echo '${{ toJSON(needs.build.outputs) }}' \ | |
| | jq '[with_entries(.key |= sub("^resolc-web_js_"; "resolc-web.js_"))]' > data.json | |
| chmod +x bins/resolc-x86_64-unknown-linux-musl | |
| export FIRST_SOLC_VERSION=$(./bins/resolc-x86_64-unknown-linux-musl --supported-solc-versions | cut -f 1 -d "," | tr -d ">=") | |
| export LAST_SOLC_VERSION=$(./bins/resolc-x86_64-unknown-linux-musl --supported-solc-versions | cut -f 2 -d "," | tr -d "<=") | |
| export FILEPATH=$(readlink -f data.json) | |
| export TAG=$(cd revive;gh release list --json name --jq '[.[] | select(.name | startswith("v"))][0].name') | |
| cd resolc-bin | |
| mkdir -p nightly | |
| cd nightly | |
| python3 ../../revive/.github/scripts/json_generator_nightly.py | |
| cd .. | |
| # Update GitHub Pages file with the JSON data. | |
| chmod +x ../revive/.github/scripts/resolc-bin-gh-pages.sh | |
| bash ../revive/.github/scripts/resolc-bin-gh-pages.sh $PWD | |
| git status | |
| git config user.email "ci@parity.io" | |
| git config user.name "${APP_NAME}" | |
| git add nightly/ index.md | |
| git commit -m "Update nightly json" | |
| git push origin main | |
| echo "::notice::nightly info.list files were successfully published to https://github.com/paritytech/resolc-bin" |