Skip to content

Commit

Permalink
[DOP-18232] - add CI release
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-lixakov committed Sep 3, 2024
1 parent 1cb8331 commit 4a5a04f
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release
on:
push:
branches: [master, develop]
tags: ["*"]
pull_request:
branches: [master, develop]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt

- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
54 changes: 53 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,56 @@ To lint and refactor the code, run Scalafix using the following command:
```bash
sbt scalafixAll
```
This command checks the code against various rules specified in the ```.scalafix.conf``` file and applies fixes where possible.
This command checks the code against various rules specified in the ```.scalafix.conf``` file and applies fixes where possible.


## Release process


1. Checkout to ``develop`` branch and update it to the actual state

```bash
git checkout develop
git pull -p
```

2. Copy version (it must start with **v**, e.g. **v1.0.0**)

```bash
VERSION=$(cat VERSION)
```

3. Commit and push changes to ``develop`` branch

```bash
git add .
git commit -m "Prepare for release ${VERSION}"
git push
```

4. Merge ``develop`` branch to ``master``, **WITHOUT** squashing

```bash
git checkout master
git pull
git merge develop
git push
```

5. Add git tag to the latest commit in ``master`` branch

```bash
git tag "$VERSION"
git push origin "$VERSION"
```

6. Update version in ``develop`` branch **after release**:

```bash
git checkout develop
NEXT_VERSION=$(echo "$VERSION" | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.)
echo "$NEXT_VERSION" > VERSION
git add .
git commit -m "Bump version"
git push
```
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.0.1
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name := "spark-dialect-extension"

organization := "ru.mts.doetl"
organization := "io.github.mtsongithub.doetl"
organizationName := "Mobile Telesystems"

version := "0.1"
// minimum compatible version with scalafix
scalaVersion := "2.12.19"

Expand All @@ -15,6 +14,9 @@ startYear := Some(2024)

licenses += "Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")

sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"


inThisBuild(List(
semanticdbEnabled := true, // enable SemanticDB
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addSbtPlugin("org.scalameta" %% "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.mts.doetl.sparkdialectextensions
package io.github.mtsongithub.doetl.sparkdialectextensions

import scala.util.matching.Regex
import org.apache.spark.sql.jdbc.{JdbcDialect, JdbcType}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.mts.doetl.sparkdialectextensions
package io.github.mtsongithub.doetl.sparkdialectextensions

import org.scalatest.prop.{TableDrivenPropertyChecks, TableFor3}
import org.scalatest.funsuite.AnyFunSuite
Expand All @@ -7,7 +7,7 @@ import org.apache.spark.sql.jdbc.JdbcDialects
import org.apache.spark.sql.types.Metadata
import org.apache.spark.sql.Row
import org.apache.spark.sql.types._
import ru.mts.doetl.sparkdialectextensions.clickhouse.{ClickhouseDataframeGenerator, ClickhouseFixture}
import io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse.{ClickhouseDataframeGenerator, ClickhouseFixture}

class ClickhouseDialectTest
extends AnyFunSuite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.mts.doetl.sparkdialectextensions
package io.github.mtsongithub.doetl.sparkdialectextensions

import org.apache.spark.sql.SparkSession
import org.scalatest.BeforeAndAfterAll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.mts.doetl.sparkdialectextensions.clickhouse
package io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse

import org.apache.spark.sql.types._
import org.apache.spark.sql.{DataFrame, Row, SparkSession}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.mts.doetl.sparkdialectextensions.clickhouse
package io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse

import io.github.cdimascio.dotenv.Dotenv
import org.scalatest.{BeforeAndAfterEach, Suite}
Expand Down

0 comments on commit 4a5a04f

Please sign in to comment.