Skip to content

Commit

Permalink
[Feat] continuous-delivery via Github Actions (#3)
Browse files Browse the repository at this point in the history
Initial commit for workflow yml file of Github Actions.
Tests should be performed before merged into master.
  • Loading branch information
MijazzChan authored Feb 24, 2022
1 parent 06cf087 commit cad556e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/manual-triggered-tag-based-release.yml
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 }



4 changes: 4 additions & 0 deletions dev-misc/release-file-include
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cfddns.sh
cloudflare-ddns
README.md
LICENSE

0 comments on commit cad556e

Please sign in to comment.