Skip to content

Publish Lists

Publish Lists #1233

Workflow file for this run

---
name: Publish Lists
on:
schedule:
- cron: "27 13 * * *"
workflow_dispatch:
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions: read-all
jobs:
build_lists:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
container:
image: ghcr.io/t145/black-mirror:latest
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
options: --user root
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
submodules: true
- name: Export secrets
uses: Firenza/secrets-to-env@v1.3.0
with:
secrets: ${{ toJSON(secrets) }}
- name: Generate lists
id: build
run: |
chmod -R 755 ./scripts/*
./scripts/github/workflow.bash
- name: Dump output context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
# https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files=
- name: Archive lists
if: steps.build.outputs.status == 'success'
run: tar -cvf lists.tar build/
- name: Cache lists
if: steps.build.outputs.status == 'success'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: lists
path: lists.tar
if-no-files-found: error
retention-days: 1
- name: Cache documents
if: steps.build.outputs.status == 'success'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: docs
path: |
logs/*
README.md
if-no-files-found: error
retention-days: 1
- name: Delete lists
if: always()
run: rm -rf build/ && rm -f lists.tar
upload_release:
runs-on: ubuntu-22.04
needs: build_lists
continue-on-error: true
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
# https://github.com/actions/download-artifact#limitations=
- name: Fetch lists
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: lists
- name: Extract & verify lists
run: |
tar -xvf lists.tar
cd build/
sha256sum CHECKSUMS.txt
cd ..
# https://github.com/softprops/action-gh-release
- name: Create release
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
with:
files: build/*
generate_release_notes: true
tag_name: latest
name: All Artifacts
- name: Delete lists
if: always()
run: rm -rf build/ && rm -f lists.tar
- name: Delete lists artifact
if: always()
uses: GeekyEggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52
with:
name: lists
update_docs:
runs-on: ubuntu-22.04
needs: upload_release
permissions: write-all
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Generate changelog
uses: tj-actions/github-changelog-generator@v1.20
- name: Fetch documents
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: docs
- name: Delete docs artifact
uses: GeekyEggo/delete-artifact@e46cfb9575865f907c2beb2e4170b5f4c7d77c52
with:
name: docs
- name: Make the working tree safe
run: git config --global --add safe.directory /__w/black-mirror/black-mirror
- name: Update documents
uses: stefanzweifel/git-auto-commit-action@050015d40644de3e8d2365687c1fbc235352bcff
with:
# homage to the python linting utility "black"
commit_message: "ci(build): ✨🍰✨"