diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index eb7fab9..07e319c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -17,7 +17,6 @@ jobs: - name: build dist run: | - git submodule init && git submodule update ./dist.sh ls -la @@ -28,6 +27,7 @@ jobs: artifacts: "adguardcert-*.zip" token: ${{ secrets.GITHUB_TOKEN }} generateReleaseNotes: true + prerelease: ${{ contains(github.ref, '-') }} - name: write PR url if: github.event_name == 'pull_request' @@ -43,3 +43,10 @@ jobs: adguardcert-*.zip README.md pull_request_url.txt + + - name: update json + if: startsWith(github.ref, 'refs/tags/v') + run: | + ./update.sh + git push origin master + ls -la diff --git a/module/module.prop b/module/module.prop index e1a62db..7687b7d 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ id=adguardcert name=AdGuard Certificate -version=v2.1-beta1 -versionCode=35 +version=v2.1 +versionCode=36 author=AdGuard description=Moves AdGuard's root CA certificate from the user certificate store to the system certificate store. updateJson=https://raw.githubusercontent.com/AdguardTeam/adguardcert/master/update.json diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..6675b19 --- /dev/null +++ b/update.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +case version in +*-*) + ;; +*) + git checkout -B master origin/master + cat module/module.prop | ( + IFS="=" + while read k v; do + read $k <<< "$v" + done + cat << EOF > update.json +{ + "version": "$version", + "versionCode": $versionCode, + "zipUrl": "https://github.com/AdguardTeam/adguardcert/releases/download/$version/adguardcert-$version.zip", + "changelog": "https://github.com/AdguardTeam/adguardcert/releases/tag/$version" +} +EOF + ) + git add update.json + git commit -m "skipci: Update update.json" + ;; +esac