diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..f7ea1ec --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Check for updates to GitHub Actions every month + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml new file mode 100644 index 0000000..00b5979 --- /dev/null +++ b/.github/workflows/sync.yaml @@ -0,0 +1,37 @@ +name: Sync Mirror + +on: + schedule: + - cron: '45 5 * * 0' + +jobs: + + sync-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: awalsh128/cache-apt-pkgs-action@v1 + with: + packages: > + libxml2-utils + - name: Get the latest release from ETSI + run: | + HOST="https://www.etsi.org" + ARTIFACTORY="$HOST/deliver/etsi_ts/103600_103699/103634" + AGENT="Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/122.0" + # Get the location of the latest release + LATEST=$(curl -sSL -A "$AGENT" $ARTIFACTORY | xmllint --html --xpath 'string((//a/@href)[last()])' -) + echo "Latest release: $LATEST" + # Get the latest release archive + URL=$(curl -sSL -A "$AGENT" $HOST$LATEST | xmllint --html --xpath '//a/@href' - | awk -F\" '/zip/ {print $2}') + echo "Latest release archive: $URL" + # Download the latest release archive + curl -sSL -A "$AGENT" $HOST$URL -o ${{ runner.temp }}/lc3plus.zip + unzip ${{ runner.temp }}/lc3plus.zip -d ${{ runner.temp }} + # Apply the changes on top of the current state + rm -rf * # Clean up the working directory, so we will see deleted files + mv ${{ runner.temp }}/LC3plus*/* . + - name: Verify changes + run: | + git add . + git diff --cached --exit-code