Skip to content

Commit 4a5a04f

Browse files
author
maxim-lixakov
committed
[DOP-18232] - add CI release
1 parent 1cb8331 commit 4a5a04f

File tree

10 files changed

+94
-9
lines changed

10 files changed

+94
-9
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [master, develop]
5+
tags: ["*"]
6+
pull_request:
7+
branches: [master, develop]
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 8
22+
cache: sbt
23+
24+
- run: sbt ci-release
25+
env:
26+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
27+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
28+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
29+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

CONTRIBUTING.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,56 @@ To lint and refactor the code, run Scalafix using the following command:
7070
```bash
7171
sbt scalafixAll
7272
```
73-
This command checks the code against various rules specified in the ```.scalafix.conf``` file and applies fixes where possible.
73+
This command checks the code against various rules specified in the ```.scalafix.conf``` file and applies fixes where possible.
74+
75+
76+
## Release process
77+
78+
79+
1. Checkout to ``develop`` branch and update it to the actual state
80+
81+
```bash
82+
git checkout develop
83+
git pull -p
84+
```
85+
86+
2. Copy version (it must start with **v**, e.g. **v1.0.0**)
87+
88+
```bash
89+
VERSION=$(cat VERSION)
90+
```
91+
92+
3. Commit and push changes to ``develop`` branch
93+
94+
```bash
95+
git add .
96+
git commit -m "Prepare for release ${VERSION}"
97+
git push
98+
```
99+
100+
4. Merge ``develop`` branch to ``master``, **WITHOUT** squashing
101+
102+
```bash
103+
git checkout master
104+
git pull
105+
git merge develop
106+
git push
107+
```
108+
109+
5. Add git tag to the latest commit in ``master`` branch
110+
111+
```bash
112+
git tag "$VERSION"
113+
git push origin "$VERSION"
114+
```
115+
116+
6. Update version in ``develop`` branch **after release**:
117+
118+
```bash
119+
git checkout develop
120+
NEXT_VERSION=$(echo "$VERSION" | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.)
121+
echo "$NEXT_VERSION" > VERSION
122+
git add .
123+
git commit -m "Bump version"
124+
git push
125+
```

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.0.1

build.sbt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name := "spark-dialect-extension"
22

3-
organization := "ru.mts.doetl"
3+
organization := "io.github.mtsongithub.doetl"
44
organizationName := "Mobile Telesystems"
55

6-
version := "0.1"
76
// minimum compatible version with scalafix
87
scalaVersion := "2.12.19"
98

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

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

17+
sonatypeCredentialHost := "s01.oss.sonatype.org"
18+
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
19+
1820

1921
inThisBuild(List(
2022
semanticdbEnabled := true, // enable SemanticDB

project/plugins.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
addSbtPlugin("org.scalameta" %% "sbt-scalafmt" % "2.5.2")
22
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0")
33
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
4+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1")

src/main/scala/ru/mts/doetl/sparkdialectextensions/ClickhouseDialectExtension.scala renamed to src/main/scala/io/github/mtsongithub/doetl/sparkdialectextensions/ClickhouseDialectExtension.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.mts.doetl.sparkdialectextensions
1+
package io.github.mtsongithub.doetl.sparkdialectextensions
22

33
import scala.util.matching.Regex
44
import org.apache.spark.sql.jdbc.{JdbcDialect, JdbcType}

src/test/scala/ru/mts/doetl/sparkdialectextensions/ClickhouseDialectTest.scala renamed to src/test/scala/io/github/mtsongithub/doetl/sparkdialectextensions/ClickhouseDialectTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.mts.doetl.sparkdialectextensions
1+
package io.github.mtsongithub.doetl.sparkdialectextensions
22

33
import org.scalatest.prop.{TableDrivenPropertyChecks, TableFor3}
44
import org.scalatest.funsuite.AnyFunSuite
@@ -7,7 +7,7 @@ import org.apache.spark.sql.jdbc.JdbcDialects
77
import org.apache.spark.sql.types.Metadata
88
import org.apache.spark.sql.Row
99
import org.apache.spark.sql.types._
10-
import ru.mts.doetl.sparkdialectextensions.clickhouse.{ClickhouseDataframeGenerator, ClickhouseFixture}
10+
import io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse.{ClickhouseDataframeGenerator, ClickhouseFixture}
1111

1212
class ClickhouseDialectTest
1313
extends AnyFunSuite

src/test/scala/ru/mts/doetl/sparkdialectextensions/SharedSparkSession.scala renamed to src/test/scala/io/github/mtsongithub/doetl/sparkdialectextensions/SharedSparkSession.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.mts.doetl.sparkdialectextensions
1+
package io.github.mtsongithub.doetl.sparkdialectextensions
22

33
import org.apache.spark.sql.SparkSession
44
import org.scalatest.BeforeAndAfterAll

src/test/scala/ru/mts/doetl/sparkdialectextensions/clickhouse/ClickhouseDataframeGenerator.scala renamed to src/test/scala/io/github/mtsongithub/doetl/sparkdialectextensions/clickhouse/ClickhouseDataframeGenerator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.mts.doetl.sparkdialectextensions.clickhouse
1+
package io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse
22

33
import org.apache.spark.sql.types._
44
import org.apache.spark.sql.{DataFrame, Row, SparkSession}

src/test/scala/ru/mts/doetl/sparkdialectextensions/clickhouse/ClickhouseFixture.scala renamed to src/test/scala/io/github/mtsongithub/doetl/sparkdialectextensions/clickhouse/ClickhouseFixture.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ru.mts.doetl.sparkdialectextensions.clickhouse
1+
package io.github.mtsongithub.doetl.sparkdialectextensions.clickhouse
22

33
import io.github.cdimascio.dotenv.Dotenv
44
import org.scalatest.{BeforeAndAfterEach, Suite}

0 commit comments

Comments
 (0)