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

feat: Remove travis scripts and add github actions for release purpose #1033

Merged
merged 10 commits into from
Dec 15, 2020
54 changes: 54 additions & 0 deletions .github/workflows/release-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Deploy
on:
# Trigger the workflow on push only for the master branch
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
flacatus marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: '10'
flacatus marked this conversation as resolved.
Show resolved Hide resolved
- name: Generate tag utilities
id: TAG_UTIL
run: |
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
echo "::set-output name=current_hour::$(date +'%Y%m%d%H%M%S')"
echo "::set-output name=current_date::$(date +'%Y%m%d')"
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
git config --local user.name "Flavius Lacatusu"
benoitf marked this conversation as resolved.
Show resolved Hide resolved
git config --local user.email "flacatus@redhat.com"

export CHECTL_VERSION=0.0.${{ steps.TAG_UTIL.outputs.current_date }}-next
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"$CHECTL_VERSION\",#g" package.json

git tag ${{ steps.TAG_UTIL.outputs.short_sha }}
yarn
TARGETS=linux-arm,linux-x64,linux-s390x,linux-ppc64le,darwin-x64,win32-x64,win32-x86
npx oclif-dev pack --targets=$TARGETS

git clone https://github.com/flacatus/chectl -b gh-pages --single-branch gh-pages
rm -rf gh-pages/.git
echo $(date +%s) > gh-pages/update
env
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: gh-pages # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.TAG_UTIL.outputs.current_hour }}
prerelease: false
title: 0.0.${{ steps.TAG_UTIL.outputs.current_date }}-next.${{ steps.TAG_UTIL.outputs.short_sha }}
files: "./dist/channels/**/chectl-*.gz"
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ deploy:
repo: che-incubator/chectl
tags: false
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(master|release)$
condition: $TRAVIS_BRANCH =~ ^(release)$
- provider: pages
github-token:
secure: eTiUIxetw+W54y7TIb3qttWPn0WFjotRamkzuILhzkWJOS21XpHJQNd/xi+fiS0q0bYaVBlnGR/z1xrJNPwjvygG6OMu7eIiDS7oHEXeH9i3WexmYlXesvuxVDVPieKMqfsctCNPP5dZim4aesRQ69kl64NE7ODLpu1DFdPwupjZOFl9VdjP0JdvdAWBrvRE/xe/bfJPfZb0DaLjXN6Cuf4Fh/r27U9avMFFFYMSkNInw2zqSos5yjDIgsTVd2ZEPrp7x0DWfQBmPrY7y7grRevLsZQI+J0e0yDpookb4VyGtI6dj53B3aO+PZ9nu852HWxrYHoYauzvdQOzsHqf/Q48a8yWHoBpcsA3iv4co264iETHBzfZDpuctatfX3xfKub3bD89cgt000vNhb/ynBvEtTsQkyccE5ZRJq9q53zemvdjNuVZeqrNyqWdgUYhOnNzAk69Nsv2dlPoY9kfCV63TC8r3Emq7PsTRF72D9KheLuMhObNRyg7SUD1BDqsESslOYx8KU9ifcWKyTd5GTrMSggNHSH7uctKzd3avSbWpetBkfxkEujOhLTnPnQEnq/yUqIWl3cK0uL6kKukkEz2/ycRvb8b760GnOxC0OJBxKENt/FDGW3+ydSWmhiH9plEhV68EJVGExrj+HMy73NLE3QlsngwPqFCogHBlvc=
Expand All @@ -59,4 +59,4 @@ deploy:
on:
repo: che-incubator/chectl
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(master|release)$
condition: $TRAVIS_BRANCH =~ ^(release)$