Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/update-dmd-rewrite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

name: Update DMD rewrite
on:
schedule:
- cron: "0 0 * * *" # run every day at 00:00
workflow_dispatch: # enable manual runs

permissions:
contents: write

jobs:
update-dmd-rewrite:
name: Update DMD rewrite
if: github.repository == 'ldc-developers/ldc' # don't run for forks
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
submodules: false
- name: Install git-filter-repo v2.34.0
run: |
set -eux
sudo apt-get -q update
sudo apt-get install -yq git-filter-repo
- run: tools/update-dmd-rewrite.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions tools/update-dmd-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This reverts commit 4b76bfcb2eb24bb8786bd293201a5711fbf747fe==>This reverts comm
EOF

# clone DMD monorepo
git clone git@github.com:dlang/dmd.git dmd.tmp
git clone https://github.com/dlang/dmd.git dmd.tmp
cd dmd.tmp

# only for initialization:
Expand Down Expand Up @@ -86,7 +86,11 @@ git branch --no-track "${refs_prefix}master" master
git branch --no-track "${refs_prefix}stable" stable

# add LDC repo as `ldc` remote
git remote add ldc [email protected]:ldc-developers/ldc.git
if [[ -v GITHUB_TOKEN ]]; then
git remote add ldc https://git:${GITHUB_TOKEN}@github.com/ldc-developers/ldc.git
else
git remote add ldc [email protected]:ldc-developers/ldc.git
fi

# check for newly added DMD source files
if [[ "$initialize" != 1 ]]; then
Expand Down
Loading