-
Notifications
You must be signed in to change notification settings - Fork 65
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
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac3bd9a
feat: Remove travis scripts and add github actions
flacatus 475e042
fix:_Add travis file
flacatus dfbca85
feat: change workflow name and add common release push for stable and…
flacatus 4a3ebd7
feat: Change node version and ubuntu version
flacatus 0c7d8ab
Add unit tests to PRs
flacatus d971606
fixes
flacatus 34c42e6
fixes
flacatus d7d77aa
fix
flacatus 6d1031e
fix: remove unnecessary thinkgs and rename the workflows
flacatus 6da3f11
Fixes
flacatus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,29 @@ | ||
# This Workflow performs a full release of chectl | ||
name: Release chectl | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version that is going to be released. Should be in format 7.y.z' | ||
required: true | ||
default: '7.y.z' | ||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.ACTIONS_TOKEN }} | ||
- uses: actions/setup-node@v2.1.2 | ||
with: | ||
node-version: 12.18.2 | ||
- name: Run make-release.sh script | ||
run: | | ||
# since we're using Flavius' token below to generate PRs, should also make tags/branches/commits by same owner | ||
# see https://github.com/che-incubator/chectl/settings/secrets/actions for the token used | ||
git config --global user.name "Flavius Lacatusu" | ||
git config --global user.email "flacatus@redhat.com" | ||
export GITHUB_TOKEN=${{ secrets.ACTIONS_TOKEN }} | ||
/bin/bash -x make-release.sh --version ${{ github.event.inputs.version }} |
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 |
---|---|---|
@@ -1,29 +1,79 @@ | ||
# This Workflow performs a full release of chectl | ||
name: Release chectl | ||
# | ||
# Copyright (c) 2012-2020 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
name: Build and Deploy release artifacts ⌛ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version that is going to be released. Should be in format 7.y.z' | ||
required: true | ||
default: '7.y.z' | ||
# Trigger the workflow on push only for the master branch | ||
push: | ||
branches: | ||
- '7*' # Push events to matching 7.* branches | ||
- 'master' | ||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
build-and-deploy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2.3.1 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.ACTIONS_TOKEN }} | ||
nickboldt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: actions/setup-node@v2.1.2 | ||
persist-credentials: false | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.18.2 | ||
- name: Run make-release.sh script | ||
node-version: '12' | ||
- name: Generate tag utilities 📜 | ||
id: TAG_UTIL | ||
run: | | ||
# since we're using Flavius' token below to generate PRs, should also make tags/branches/commits by same owner | ||
# see https://github.com/che-incubator/chectl/settings/secrets/actions for the token used | ||
git config --global user.name "Flavius Lacatusu" | ||
git config --global user.email "flacatus@redhat.com" | ||
export GITHUB_TOKEN=${{ secrets.ACTIONS_TOKEN }} | ||
/bin/bash -x make-release.sh --version ${{ github.event.inputs.version }} | ||
echo "::set-output name=gh_tag::$(date +'%Y%m%d%H%M%S')" | ||
nickboldt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if [[ ${GITHUB_REF#refs/heads/} =~ 7.* ]];s | ||
then | ||
echo "::set-output name=chectl_version::$(cat VERSION)" | ||
echo "::set-output name=gh_release_name::$(cat VERSION)" | ||
fi | ||
if [[ ${GITHUB_REF#refs/heads/} =~ master ]]; | ||
then | ||
CURRENT_DAY=$(date +'%Y%m%d') | ||
SHORT_SHA1=$(git rev-parse --short HEAD) | ||
export CHECTL_VERSION=0.0.$CURRENT_DAY-next | ||
echo "::set-output name=chectl_version::0.0.$CURRENT_DAY-next" | ||
nickboldt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "::set-output name=gh_release_name::0.0.$CURRENT_DAY-next.$SHORT_SHA1" | ||
fi | ||
- name: Install chectl dependencies 🔧 | ||
run: yarn | ||
- name: Run unit tests 🩺 | ||
run: yarn test | ||
- name: Pack chectl 🎒 | ||
nickboldt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
git config --local user.name "Flavius Lacatusu" | ||
git config --local user.email "flacatus@redhat.com" | ||
|
||
sed -i "s#version\":\ \"\(.*\)\",#version\":\ \"${{ steps.TAG_UTIL.outputs.chectl_version }}\",#g" package.json | ||
git tag ${{ steps.TAG_UTIL.outputs.gh_tag }} | ||
|
||
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/che-incubator/chectl -b gh-pages --single-branch gh-pages | ||
rm -rf gh-pages/.git | ||
echo $(date +%s) > gh-pages/update | ||
env | ||
- name: Deploy to github pages 📈 | ||
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 | ||
- name: Create Release and push artifacts 🚀 | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ steps.TAG_UTIL.outputs.gh_release_name }} | ||
tag_name: ${{ steps.TAG_UTIL.outputs.gh_tag }} | ||
files: "./dist/channels/**/chectl-*.gz" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,28 @@ | ||
# | ||
# Copyright (c) 2012-2020 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
name: Chectl | ||
on: [pull_request, push] | ||
flacatus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-20.04 | ||
name: Unit Tests | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v2.3.1 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12' | ||
- name: Install chectl dependencies 🔧 | ||
run: yarn | ||
- name: Run unit tests 🩺 | ||
run: yarn test |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be author that perform the release ?