-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] continuous-delivery via Github Actions (#3)
Initial commit for workflow yml file of Github Actions. Tests should be performed before merged into master.
- Loading branch information
1 parent
06cf087
commit cad556e
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cfddns.sh | ||
cloudflare-ddns | ||
README.md | ||
LICENSE |