diff --git a/.github/workflows/manual-triggered-tag-based-release.yml b/.github/workflows/manual-triggered-tag-based-release.yml new file mode 100644 index 0000000..1ba8f53 --- /dev/null +++ b/.github/workflows/manual-triggered-tag-based-release.yml @@ -0,0 +1,47 @@ +name: Manual Triggered Release + +on: workflow_dispatch + +jobs: + release-on-tag: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout - Fetch all History & tags + id: checkout + uses: actions/checkout@v2 + with: + ref: master + clean: true + fetch-depth: 0 + + - name: Check if workflow should run + id: tagcheck + run: | + headtag=$(git log -n 1 --decorate --pretty=oneline | sed -n -e 's/^.*tag\:\s\(v\S*\),.*$/\1/p' | xargs) + if [ -z $headtag ] ; then exit 1 ; fi + echo "::set-output name=tagname::$(echo $headtag)" + + - name: Prepare commit for release branch + id: mkcommit + if: steps.tagcheck.conclusion == 'success' + run: | + mkdir -p /tmp/cloudflare-ddns-edgeos/ + while IFS= read -r filename ; do if [ -f ./"$filename" ]; then cp "$filename" /tmp/cloudflare-ddns-edgeos/ ; fi ; done < ./dev-misc/release-file-include + tar -cvz --exclude-vcs -f /tmp/cloudflare-ddns-edgeos.tar.gz /tmp/cloudflare-ddns-edgeos/ + mkdir ./release_dir && mv /tmp/cloudflare-ddns-edgeos.tar.gz ./release_dir + + - name: Commit & Push to release branch + id: publish + if: steps.tagcheck.conclusion == 'success' + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: release + FOLDER: release_dir + SQUASH_HISTORY: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MESSAGE: $${ steps.tagcheck.outputs.tagname } + + + diff --git a/dev-misc/release-file-include b/dev-misc/release-file-include new file mode 100644 index 0000000..b0b8b4f --- /dev/null +++ b/dev-misc/release-file-include @@ -0,0 +1,4 @@ +cfddns.sh +cloudflare-ddns +README.md +LICENSE