Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kpritam committed Apr 1, 2020
1 parent 15aea76 commit 9befd77
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
- name: Notify slack
if: always()
continue-on-error: true
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: pullreminders/slack-action@master
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: olafurpg/setup-scala@v5
with:
java-version: [email protected]

- uses: actions/setup-node@v1
with:
node-version: "13.x"
registry-url: "https://registry.npmjs.org"

- run: npm install -g junit-merge
- run: npm install -g junit-viewer

- name: Build
run: |
sbt test:compile multi-jvm:compile
sbt makeSite
- name: Tests
run: sbt -DenableCoverage=true -DgenerateStoryReport=true test:test

- name: Coverage Report
run: |
sbt -DenableCoverage=true coverageReport
sbt coverageAggregate
- name: RTM
run: |
./scripts/coursier launch -r jitpack -r https://jcenter.bintray.com com.github.tmtsoftware:rtm_2.13:47b635b289 -M tmt.test.reporter.TestRequirementMapper -- target/RTM/testStoryMapping.txt tools/RTM/storyRequirementMapping.csv target/RTM/testRequirementsMapping.txt
- name: Upload Coverage Report
uses: actions/upload-artifact@v1
with:
name: Coverage Report
path: target/scala-2.13/scoverage-report

- name: Upload RTM
uses: actions/upload-artifact@v1
with:
name: RTM
path: target/RTM

- name: Delete js targets
continue-on-error: true
run: find . -type d -regex ".*js/target.*" | xargs rm -rf

- name: Multi-Jvm Tests
run: sbt esw-integration-test/multi-jvm:test

- name: Github Release
run: sbt -Dprod.publish=true githubRelease
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

- name: Docs Publish
run: |
echo 'echo $RELEASE_TOKEN' > /tmp/.git-askpass
chmod +x /tmp/.git-askpass
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
sbt -Dprod.publish=true clean ghpagesPushSite
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GIT_ASKPASS: /tmp/.git-askpass

- name: Build Status
if: always()
id: status
run: |
if [[ ${{job.status}} == Success ]]
then
echo ::set-output name=title::'SUCCESS'
echo ::set-output name=color::'#00FF00'
else
echo ::set-output name=title::'FAILURE'
echo ::set-output name=color::'#FF0000'
fi
- name: Notify slack
if: always()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: pullreminders/slack-action@master
with:
args: '{\"channel\":\"#esw-prod-release\", \"attachments\": [ { \"title\":\"${{ steps.status.outputs.title }}\", \"text\": \"[ ${{ github.event.repository.name }} ] : [ ${{ github.workflow }} ] : [ ${{ github.ref }} ] \n https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\", \"color\": \"${{ steps.status.outputs.color }}\" } ]}'
1 change: 1 addition & 0 deletions notes/0.1.1-SNAPSHOT.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# [DO NOT USE - Test Release]
2 changes: 1 addition & 1 deletion project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object Common extends AutoPlugin {
ScmInfo(url(EswKeys.homepageValue), "[email protected]:tmtsoftware/esw.git")
),
// ======== sbt-docs Settings =========
docsRepo := "git@github.com:tmtsoftware/tmtsoftware.github.io.git",
docsRepo := "https://github.com/tmtsoftware/tmtsoftware.github.io.git",
docsParentDir := EswKeys.projectName,
gitCurrentRepo := "https://github.com/tmtsoftware/esw",
// ================================
Expand Down
2 changes: 1 addition & 1 deletion project/metals.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT! This file is auto-generated.
// This file enables sbt-bloop to create bloop config files.

addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.0-RC1")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.0-RC1-162-888454e1")
16 changes: 16 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

if [[ $# -ne 1 || $1 != v* ]]; then
echo "Single VERSION number argument prefixed with 'v' expected ..."
exit 2
fi

VERSION=$1

if [[ $PROD == true ]]; then
git tag "$VERSION"
git push origin "$VERSION"
echo "Succeffully tagged with $VERSION"
else
echo "Set PROD=true environment variable to release ..."
fi

0 comments on commit 9befd77

Please sign in to comment.