Skip to content

Commit

Permalink
Use github actions for automatic releases (#1376)
Browse files Browse the repository at this point in the history
* Use github actions for automatic releases

* Use ci-release command
  • Loading branch information
muuki88 committed Oct 21, 2020
1 parent a065120 commit 97ddbbe
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 281 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release
on:
push:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: show release version
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.ivy2/cache
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
- uses: olafurpg/setup-scala@v10
- uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

# github_changelog_generator
- name: Generate changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
unreleased: true
cacheFile: '.github-changelog-cache'
- name: Push CHANGELOG.md
uses: EndBug/add-and-commit@v5
with:
add: 'CHANGELOG.md'
author_name: github-actions
author_email: github-actions@github.com
branch: master
message: 'Update CHANGELOG.md for release ${{ env.RELEASE_VERSION }}'
signoff: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# generate a github release
- name: Generate release changelog
id: changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
cacheFile: '.github-changelog-cache'
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
unreleased: false
onlyLastTag: true
output: LATEST_RELEASE.md
- name: Read latest_release.md
id: release_changelog
uses: juliangruber/read-file-action@v1
with:
path: ./LATEST_RELEASE.md
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: ${{ steps.release_changelog.outputs.content }}
draft: false
prerelease: false
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

8 changes: 2 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ import ReleaseTransformations._
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
runTest,
releaseStepCommandAndRemaining("^ publish"),
releaseStepCommandAndRemaining("^ publishSigned"),
updateReadme,
commitReadme,
pushChanges,
generateReleaseChangelog,
commitChangelog,
pushChanges,
releaseStepTask(ghpagesPushSite)
)

Expand Down Expand Up @@ -116,4 +112,4 @@ addCommandAlias("validateWindows", "; testOnly * -- -n windows ; scripted univer

addCommandAlias("validateJlink", "scripted jlink/*")

addCommandAlias("releaseFromTravis", "release with-defaults")
addCommandAlias("ci-release", "release with-defaults")
160 changes: 0 additions & 160 deletions project/ChangelogPlugin.scala

This file was deleted.

4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ resolvers += sbt.Resolver.bintrayIvyRepo("typesafe", "sbt-plugins")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.3")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.0.0")
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

Expand Down
Binary file removed project/secrets.tar.enc
Binary file not shown.
53 changes: 0 additions & 53 deletions release-travis.sh

This file was deleted.

0 comments on commit 97ddbbe

Please sign in to comment.