Skip to content

Publish Lists

Publish Lists #1660

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:
if: github.ref == 'refs/heads/master'
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@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
submodules: true
- name: Export secrets
uses: Firenza/[email protected]
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f
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@b7c566a772e6b6bfb58ed0dc250532a479d7789f
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@8e8c483db84b4bee98b60c0593521ed34d9990e8
# https://github.com/actions/download-artifact#limitations=
- name: Fetch lists
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
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@7b4da11513bf3f43f9999e90eabced41ab8bb048
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@8e8c483db84b4bee98b60c0593521ed34d9990e8
with:
fetch-depth: 0
- name: Generate changelog
uses: tj-actions/github-changelog-generator@e4a45c3859c94e2c758d2676a450eae09110a3f0
- name: Fetch documents
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
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@0b492c0d951b87f3cd12523a542dbd156c1dbc80
with:
# homage to the python linting utility "black"
commit_message: "ci(build): ✨🍰✨"