From 5a3522c6e5447aeaa5b1b41a1ce38eb0c0d3fc5f Mon Sep 17 00:00:00 2001 From: Sharp-tailed Grouse Date: Thu, 20 Oct 2022 14:50:24 -0400 Subject: [PATCH] CI: add scheduled releases + mirror workflow * .github/workflows/release.yml: Add scheduled releases jobs of `$(git rev-parse --abbrev-ref HEAD)` to create master.zip which contains everything in the root (e.g., `./*`) of the file dir. * .github/workflows/mirror.yml: Add scheduled mirroring jobs to CI. Mirror to all private repos via SSH. Also move `.github/FUNDING.yml` to `workflows/` dir. Signed-off-by: Sharp-tailed Grouse --- .github/{ => workflows}/FUNDING.yml | 0 .github/workflows/mirror.yml | 43 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 29 +++++++++++++++++++ 3 files changed, 72 insertions(+) rename .github/{ => workflows}/FUNDING.yml (100%) create mode 100644 .github/workflows/mirror.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/workflows/FUNDING.yml similarity index 100% rename from .github/FUNDING.yml rename to .github/workflows/FUNDING.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 0000000..b5bc797 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,43 @@ +name: Mirrors + +# Push to all private (configured) mirrors. + +on: [ push, create, delete ] + +concurrency: + group: git-mirror + +jobs: + gitlab: + runs-on: ubuntu-latest + steps: + - name: GitLab + uses: wearerequired/git-mirror-action@v1 + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + with: + source-repo: "git@github.com:Anon-Planet/thgtoa.git" + destination-repo: "git@gitlab.com:{{ secrets.GITLAB_REPO_USERNAME }}/thgtoa.git" + + codeberg: + runs-on: ubuntu-latest + steps: + - name: Codeberg + uses: wearerequired/git-mirror-action@v1 + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + with: + source-repo: "git@github.com:Anon-Planet/thgtoa.git" + destination-repo: "git@codeberg.org:{{ secrets.CODEBERG_REPO_USERNAME }}/thgtoa.git" + + disroot: + runs-on: ubuntu-latest + steps: + - name: Disroot + uses: wearerequired/git-mirror-action@v1 + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + with: + source-repo: "git@github.com:Anon-Planet/thgtoa.git" + destination-repo: "git@git.disroot.org:{{ secrets.DISROOT_REPO_USERNAME }}/thgtoa.git" + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ec6c066 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +on: + push: + tags: + - "v*" + +jobs: + upload-files: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: "THGTOA" + branch: "master" + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch }} + + - name: Scheduled Release + run: | + zip -rv ${{ matrix.name }}.zip _site + + - uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: | + ${{ matrix.name }}.zip