Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Create Nightly releases #70

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_tag.outputs.git_tag }}
release_name: Release ${{ steps.get_tag.outputs.git_tag }}
draft: true
prerelease: false
release_name: ${{ steps.get_tag.outputs.git_tag }}
body_path: ./release-artifacts/changelog.md
draft: ${{ startsWith(steps.get_tag.outputs.git_tag, 'nightly') != true }}
prerelease: ${{ startsWith(steps.get_tag.outputs.git_tag, 'nightly') }}
- name: Upload Release Asset - Mac
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: nightly
on:
schedule:
- cron: '2 2 * * *'
jobs:
create-tag:
name: Create tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
with:
fetch-depth: 0

- name: Set tag name
id: git_tag
run: echo "::set-output name=tag::$(git describe --tags)"

- name: check if tag exists
id: tag_exists
run: |
set -x
[ "$(git tag -l "${TAG}")" = "${TAG}" ] && exists=true || exists=false
echo "::set-output name=result::${exists}"
env:
TAG: ${{ steps.git_tag.outputs.tag }}

- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GH_SSH_KEY }}"
if: ${{ steps.tag_exists.outputs.result != 'true' }}

- name: Create tag
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
TAG: "nightly-${{ steps.git_tag.outputs.tag }}"
run: |
git tag "${TAG}"
git remote set-url origin git@github.com:doitintl/kube-no-trouble.git
git push origin "refs/tags/${TAG}"
if: ${{ steps.tag_exists.outputs.result != 'true' }}