manual #98
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: manual | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: ["build"] | |
| types: [completed] | |
| pull_request: | |
| types: | |
| - closed | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| # GitHub Actions run without a TTY device. This is a workaround to get one, | |
| # based on https://github.com/actions/runner/issues/241#issuecomment-2019042651 | |
| shell: 'script --return --quiet --log-out /dev/null --command "bash -e {0}"' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_OWNER: ${{ github.repository_owner }} | |
| GITHUB_REPO: ${{ github.event.repository.name }} | |
| GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Tune dpkg | |
| uses: abbbi/github-actions-tune@v1 | |
| - name: Set dpkg | |
| run: sudo rm -f /usr/local/bin/dpkg | |
| - name: Tune apt | |
| uses: firebuild/apt-eatmydata-action@v1 | |
| - name: Check for release | |
| id: release | |
| continue-on-error: true | |
| uses: cardinalby/git-get-release-action@v1 | |
| with: | |
| latest: true | |
| - name: Fetch all data | |
| if: ${{ steps.release.outcome == 'success' }} | |
| continue-on-error: true | |
| uses: robinraju/release-downloader@v1 | |
| with: | |
| latest: true | |
| fileName: "*.zst" | |
| tarBall: false | |
| zipBall: false | |
| - name: Dry run | |
| id: update | |
| run: | | |
| docker run -v $PWD:/app --env-file <(env | grep GITHUB) \ | |
| ghcr.io/$GITHUB_OWNER/$GITHUB_REPO:master \ | |
| src/test/update.sh; echo "updated=$?" >> "$GITHUB_OUTPUT" | |
| - name: Get date | |
| id: date | |
| run: echo "tag=$(date -u +%-Y.%-m).$((($(date -u +%-d)-1)/14))" >> "$GITHUB_OUTPUT" | |
| - name: Save database | |
| if: ${{ steps.update.outputs.updated == '0' }} | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "*.zst" | |
| bodyFile: "CHANGELOG.md" | |
| tag: "v${{ steps.date.outputs.tag }}" | |
| commit: "master" | |
| allowUpdates: true |