Change release management
This commit is contained in:
parent
df23339dba
commit
7d76cb8eac
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -7,9 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: set up JDK 1.8
|
- name: set up JDK 1.8
|
||||||
@ -17,4 +15,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew build -Prelease
|
||||||
|
33
.github/workflows/develop.yml
vendored
33
.github/workflows/develop.yml
vendored
@ -1,33 +0,0 @@
|
|||||||
name: Snapshot
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew build -Prelease
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: deploy snapshot
|
|
||||||
env:
|
|
||||||
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
run: ./gradlew upA -Prelease -PCI
|
|
@ -1,6 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
# $nap;
|
# $SNAPSHOT;
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
* `core` - `MovementMethodPlugin.none()`, `MovementMethodPlugin.link()` factory methods
|
* `core` - `MovementMethodPlugin.none()`, `MovementMethodPlugin.link()` factory methods
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
# Markwon sample app
|
# Markwon sample app
|
||||||
|
|
||||||
|
Collection of sample snippets showing different aspects of `Markwon` library usage. Includes
|
||||||
|
source code of samples, latest stable/snapshot version of the library and search functionality.
|
||||||
|
Additionally can check for updates. Can be used to preview markdown documents from the `Github.com`.
|
||||||
|
|
||||||
|
<a href="../art/sample-screen-01.png"><img src="../art/sample-screen-01.png" width="30%" /></a>
|
||||||
|
<a href="../art/sample-screen-02.png"><img src="../art/sample-screen-02.png" width="30%" /></a>
|
||||||
|
<a href="../art/sample-screen-03.png"><img src="../art/sample-screen-03.png" width="30%" /></a>
|
||||||
|
<a href="../art/sample-screen-04.png"><img src="../art/sample-screen-04.png" width="30%" /></a>
|
||||||
|
|
||||||
## Distribution
|
## Distribution
|
||||||
|
|
||||||
Sample app is distributed via special parent-less branch [sample-store](https://github.com/noties/Markwon/tree/sample-store).
|
Sample app is distributed via special parent-less branch [sample-store](https://github.com/noties/Markwon/tree/sample-store).
|
||||||
@ -10,8 +19,10 @@ Application is signed with `keystore.jks`, which fingerprints are:
|
|||||||
* __SHA1__: `BA:70:A5:D2:40:65:F1:FA:88:90:59:BA:FC:B7:31:81:E6:37:D9:41`
|
* __SHA1__: `BA:70:A5:D2:40:65:F1:FA:88:90:59:BA:FC:B7:31:81:E6:37:D9:41`
|
||||||
* __SHA256__: `82:C9:61:C5:DF:35:B1:CB:29:D5:48:83:FB:EB:9F:3E:7D:52:67:63:4F:D2:CE:0A:2D:70:17:85:FF:48:67:51`
|
* __SHA256__: `82:C9:61:C5:DF:35:B1:CB:29:D5:48:83:FB:EB:9F:3E:7D:52:67:63:4F:D2:CE:0A:2D:70:17:85:FF:48:67:51`
|
||||||
|
|
||||||
|
|
||||||
[Download latest APK](https://github.com/noties/Markwon/raw/sample-store/markwon-debug.apk)
|
[Download latest APK](https://github.com/noties/Markwon/raw/sample-store/markwon-debug.apk)
|
||||||
|
|
||||||
|
|
||||||
## Deeplink
|
## Deeplink
|
||||||
|
|
||||||
Sample app handles special `markwon` scheme:
|
Sample app handles special `markwon` scheme:
|
||||||
@ -32,7 +43,7 @@ Please note that you might need to _url encode_ the `-d` argument
|
|||||||
|
|
||||||
When adding/removing samples _most likely_ a clean build would be required.
|
When adding/removing samples _most likely_ a clean build would be required.
|
||||||
First, for annotation processor to create `samples.json`. And secondly,
|
First, for annotation processor to create `samples.json`. And secondly,
|
||||||
in order for Android Gradle plugin to bundle resources references via
|
in order for Android Gradle plugin to bundle resources referenced via
|
||||||
symbolic links (the `sample.json` itself and `io.noties.markwon.app.samples.*` directory)
|
symbolic links (the `sample.json` itself and `io.noties.markwon.app.samples.*` directory)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -6,7 +6,7 @@ import android.view.ViewGroup
|
|||||||
import io.noties.adapt.Item
|
import io.noties.adapt.Item
|
||||||
import io.noties.markwon.app.R
|
import io.noties.markwon.app.R
|
||||||
|
|
||||||
class CheckForUpdateItem(private val action: () -> Unit) : Item<CheckForUpdateItem.Holder>(42L) {
|
class CheckForUpdateItem(private val action: () -> Unit) : Item<CheckForUpdateItem.Holder>(43L) {
|
||||||
|
|
||||||
override fun createHolder(inflater: LayoutInflater, parent: ViewGroup): Holder {
|
override fun createHolder(inflater: LayoutInflater, parent: ViewGroup): Holder {
|
||||||
return Holder(inflater.inflate(R.layout.adapt_check_for_update, parent, false))
|
return Holder(inflater.inflate(R.layout.adapt_check_for_update, parent, false))
|
||||||
|
BIN
art/sample-screen-01.png
Normal file
BIN
art/sample-screen-01.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
BIN
art/sample-screen-02.png
Normal file
BIN
art/sample-screen-02.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 142 KiB |
BIN
art/sample-screen-03.png
Normal file
BIN
art/sample-screen-03.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
BIN
art/sample-screen-04.png
Normal file
BIN
art/sample-screen-04.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
@ -8,7 +8,7 @@ android.enableJetifier=true
|
|||||||
android.enableBuildCache=true
|
android.enableBuildCache=true
|
||||||
android.buildCacheDir=build/pre-dex-cache
|
android.buildCacheDir=build/pre-dex-cache
|
||||||
|
|
||||||
VERSION_NAME=4.4.1-SNAPSHOT
|
VERSION_NAME=4.5.0-SNAPSHOT
|
||||||
|
|
||||||
GROUP=io.noties.markwon
|
GROUP=io.noties.markwon
|
||||||
POM_DESCRIPTION=Markwon markdown for Android
|
POM_DESCRIPTION=Markwon markdown for Android
|
||||||
|
@ -49,7 +49,7 @@ public abstract class MarkwonReducer {
|
|||||||
Node temp;
|
Node temp;
|
||||||
|
|
||||||
while (node != null) {
|
while (node != null) {
|
||||||
// @since $nap; do not include LinkReferenceDefinition node (would result
|
// @since $SNAPSHOT; do not include LinkReferenceDefinition node (would result
|
||||||
// in empty textView if rendered in recycler-view)
|
// in empty textView if rendered in recycler-view)
|
||||||
if (!(node instanceof LinkReferenceDefinition)) {
|
if (!(node instanceof LinkReferenceDefinition)) {
|
||||||
list.add(node);
|
list.add(node);
|
||||||
|
@ -115,14 +115,14 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
|||||||
// @since 4.0.0
|
// @since 4.0.0
|
||||||
private final List<OnTextAddedListener> onTextAddedListeners = new ArrayList<>(0);
|
private final List<OnTextAddedListener> onTextAddedListeners = new ArrayList<>(0);
|
||||||
|
|
||||||
// @since $nap;
|
// @since $SNAPSHOT;
|
||||||
private boolean hasExplicitMovementMethod;
|
private boolean hasExplicitMovementMethod;
|
||||||
|
|
||||||
protected CorePlugin() {
|
protected CorePlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $nap;
|
* @since $SNAPSHOT;
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
@NonNull
|
@NonNull
|
||||||
@ -201,7 +201,7 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
|||||||
// let's ensure that there is a movement method applied
|
// let's ensure that there is a movement method applied
|
||||||
// we do it `afterSetText` so any user-defined movement method won't be
|
// we do it `afterSetText` so any user-defined movement method won't be
|
||||||
// replaced (it should be done in `beforeSetText` or manually on a TextView)
|
// replaced (it should be done in `beforeSetText` or manually on a TextView)
|
||||||
// @since $nap; we additionally check if we should apply _implicit_ movement method
|
// @since $SNAPSHOT; we additionally check if we should apply _implicit_ movement method
|
||||||
if (!hasExplicitMovementMethod && textView.getMovementMethod() == null) {
|
if (!hasExplicitMovementMethod && textView.getMovementMethod() == null) {
|
||||||
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
private final ImageSize imageSize;
|
private final ImageSize imageSize;
|
||||||
private final ImageSizeResolver imageSizeResolver;
|
private final ImageSizeResolver imageSizeResolver;
|
||||||
|
|
||||||
// @since $nap;
|
// @since $SNAPSHOT;
|
||||||
private final Drawable placeholder;
|
private final Drawable placeholder;
|
||||||
|
|
||||||
private Drawable result;
|
private Drawable result;
|
||||||
@ -30,7 +30,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
// @since 2.0.1 for use-cases when image is loaded faster than span is drawn and knows canvas width
|
// @since 2.0.1 for use-cases when image is loaded faster than span is drawn and knows canvas width
|
||||||
private boolean waitingForDimensions;
|
private boolean waitingForDimensions;
|
||||||
|
|
||||||
// @since $nap; in case if result is Animatable and this drawable was detached, we
|
// @since $SNAPSHOT; in case if result is Animatable and this drawable was detached, we
|
||||||
// keep the state to resume when we are going to be attached again (when used in RecyclerView)
|
// keep the state to resume when we are going to be attached again (when used in RecyclerView)
|
||||||
private boolean wasPlayingBefore = false;
|
private boolean wasPlayingBefore = false;
|
||||||
|
|
||||||
@ -136,13 +136,13 @@ public class AsyncDrawable extends Drawable {
|
|||||||
result.setCallback(callback);
|
result.setCallback(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @since $nap; we trigger loading only if we have no result (and result is not placeholder)
|
// @since $SNAPSHOT; we trigger loading only if we have no result (and result is not placeholder)
|
||||||
final boolean shouldLoad = result == null || result == placeholder;
|
final boolean shouldLoad = result == null || result == placeholder;
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
result.setCallback(callback);
|
result.setCallback(callback);
|
||||||
|
|
||||||
// @since $nap;
|
// @since $SNAPSHOT;
|
||||||
if (result instanceof Animatable && wasPlayingBefore) {
|
if (result instanceof Animatable && wasPlayingBefore) {
|
||||||
((Animatable) result).start();
|
((Animatable) result).start();
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
|
|
||||||
public void setResult(@NonNull Drawable result) {
|
public void setResult(@NonNull Drawable result) {
|
||||||
|
|
||||||
// @since $nap; revert this flag when we have new source
|
// @since $SNAPSHOT; revert this flag when we have new source
|
||||||
wasPlayingBefore = false;
|
wasPlayingBefore = false;
|
||||||
|
|
||||||
// if we have previous one, detach it
|
// if we have previous one, detach it
|
||||||
|
@ -22,7 +22,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
*
|
*
|
||||||
* @see #create(MovementMethod)
|
* @see #create(MovementMethod)
|
||||||
* @see #link()
|
* @see #link()
|
||||||
* @deprecated $nap; use {@link #link()}
|
* @deprecated $SNAPSHOT; use {@link #link()}
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -31,7 +31,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $nap;
|
* @since $SNAPSHOT;
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static MovementMethodPlugin link() {
|
public static MovementMethodPlugin link() {
|
||||||
@ -42,7 +42,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
* Special {@link MovementMethodPlugin} that is <strong>not</strong> applying a MovementMethod on a TextView
|
* Special {@link MovementMethodPlugin} that is <strong>not</strong> applying a MovementMethod on a TextView
|
||||||
* implicitly
|
* implicitly
|
||||||
*
|
*
|
||||||
* @since $nap;
|
* @since $SNAPSHOT;
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static MovementMethodPlugin none() {
|
public static MovementMethodPlugin none() {
|
||||||
@ -58,7 +58,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
private final MovementMethod movementMethod;
|
private final MovementMethod movementMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since $nap; change to be <em>nullable</em>
|
* Since $SNAPSHOT; change to be <em>nullable</em>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
MovementMethodPlugin(@Nullable MovementMethod movementMethod) {
|
MovementMethodPlugin(@Nullable MovementMethod movementMethod) {
|
||||||
@ -73,7 +73,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
||||||
// @since $nap; check for equality
|
// @since $SNAPSHOT; check for equality
|
||||||
final MovementMethod current = textView.getMovementMethod();
|
final MovementMethod current = textView.getMovementMethod();
|
||||||
if (current != movementMethod) {
|
if (current != movementMethod) {
|
||||||
textView.setMovementMethod(movementMethod);
|
textView.setMovementMethod(movementMethod);
|
||||||
|
@ -83,7 +83,7 @@ public abstract class JLatexMathTheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $nap;
|
* @since $SNAPSHOT;
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static Padding of(int left, int top, int right, int bottom) {
|
public static Padding of(int left, int top, int right, int bottom) {
|
||||||
|
@ -28,7 +28,7 @@ public abstract class SimpleTagHandler extends TagHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(@NonNull MarkwonVisitor visitor, @NonNull MarkwonHtmlRenderer renderer, @NonNull HtmlTag tag) {
|
public void handle(@NonNull MarkwonVisitor visitor, @NonNull MarkwonHtmlRenderer renderer, @NonNull HtmlTag tag) {
|
||||||
// @since $nap; check if tag is block one and visit children
|
// @since $SNAPSHOT; check if tag is block one and visit children
|
||||||
if (tag.isBlock()) {
|
if (tag.isBlock()) {
|
||||||
visitChildren(visitor, renderer, tag.getAsBlock());
|
visitChildren(visitor, renderer, tag.getAsBlock());
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class GlideImagesPlugin extends AbstractMarkwonPlugin {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static GlideImagesPlugin create(@NonNull final Context context) {
|
public static GlideImagesPlugin create(@NonNull final Context context) {
|
||||||
// @since $nap; cache RequestManager
|
// @since $SNAPSHOT; cache RequestManager
|
||||||
// sometimes `cancel` would be called after activity is destroyed,
|
// sometimes `cancel` would be called after activity is destroyed,
|
||||||
// so `Glide.with(context)` will throw an exception
|
// so `Glide.with(context)` will throw an exception
|
||||||
return create(Glide.with(context));
|
return create(Glide.with(context));
|
||||||
|
@ -29,7 +29,7 @@ public class BangInlineProcessor extends InlineProcessor {
|
|||||||
|
|
||||||
return node;
|
return node;
|
||||||
} else {
|
} else {
|
||||||
// @since $nap; return null in case no match (multiple inline
|
// @since $SNAPSHOT; return null in case no match (multiple inline
|
||||||
// processors can define `!` as _special_ character, so let them handle it)
|
// processors can define `!` as _special_ character, so let them handle it)
|
||||||
// NB! do not forget to reset index
|
// NB! do not forget to reset index
|
||||||
index = startIndex;
|
index = startIndex;
|
||||||
|
@ -1,49 +1,42 @@
|
|||||||
# Release management
|
# Release management
|
||||||
|
|
||||||
There are 2 core branches:
|
Development happens in the `master` branch. Although CI (via Github workflows) is triggered
|
||||||
* `master`
|
with each push, all releases are happening in manual mode (stable and snapshot versions
|
||||||
* `develop`
|
of the library and the sample app).
|
||||||
|
|
||||||
`master` represents currently released version. In most cases its `HEAD` must also
|
```
|
||||||
point to a tag with release version name.
|
# Stable and snapshot library release (depending on the version specified in `gradle.properties`)
|
||||||
|
./gradlew upA -Prelease
|
||||||
|
|
||||||
`develop` represents version that is currently in development. It always should have
|
# Sample app release
|
||||||
`-SNAPSHOT` suffix in `VERSION_NAME` variable (defined in `gradle.properties`).
|
./app-sample/deploy.sh
|
||||||
Ideally each push to `develop` should also publish a SNAPSHOT version to MavenCentral (pending resolution).
|
```
|
||||||
|
|
||||||
Before releasing a new version a new branch is created. It's name should follow
|
Tests must be run before releasing (either locally or via CI).
|
||||||
the `v4.1.1` pattern (where `4.1.1` is upcoming release version name). In this branch
|
|
||||||
should all release preparations be done (removing all mentions of SNAPSHOT and updating
|
|
||||||
version name). Then a pull-request is issued from this branch to `master`.
|
|
||||||
|
|
||||||
After a pull-request is resolved (merged to `master`) all changes must be reflected in `develop`
|
|
||||||
branch (merge with `master`), next `VERSION_NAME` must be assigned with `-SNAPSHOT` suffix and published to snapshot Maven repo
|
|
||||||
(snapshot users will see an update available).
|
|
||||||
The issuer branch (with version name) should be deleted.
|
|
||||||
|
|
||||||
A new version must be pushed to MavenCentral and new git-tag with version name must be
|
|
||||||
created in the repository.
|
|
||||||
|
|
||||||
Rinse and repeat.
|
|
||||||
|
|
||||||
## `@since` annotation
|
## `@since` annotation
|
||||||
|
|
||||||
Although it is not required it is a nice thing to do: add `@since $VERSION` comment to the code
|
All code changes should have a documentation comment with version of the library specified.
|
||||||
whenever it is possible (at least for publicly accessible code - API). This would help
|
For changes before _stable_ release (snapshots) a special `$SNAPSHOT;` version can be used
|
||||||
navigating the project without the need to checkout the full VCS history. As keeping track of
|
(useful when the next version name of the library is still not known).
|
||||||
current and/or upcoming version can be error-prone it is better to insert a generic `@since code`
|
|
||||||
that can be properly substituted upon a release.
|
|
||||||
|
|
||||||
For example, `@since $nap` seems like a good candidate. For this a live template can be created and used
|
```java
|
||||||
whenever a new API method/field/functionality-change is introduced (`snc`):
|
/**
|
||||||
|
* @since $SNAPSHOT;
|
||||||
|
*/
|
||||||
|
|
||||||
```
|
// @since $SNAPSHOT;
|
||||||
// semicolon with a space so this one is not accedentally replaced with release version
|
|
||||||
@since $nap ;
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This live template would be possible to use in both inline comment and javadoc comment.
|
These changes must also be placed in according section of the `CHANGELOG.md` file:
|
||||||
|
* `Added`
|
||||||
|
* `Changed`
|
||||||
|
* `Fixed`
|
||||||
|
* `Deprecated`
|
||||||
|
* `Removed`
|
||||||
|
|
||||||
## documentation
|
Stable release must replace all `$SNAPSHOT;` occurrences with proper library version name.
|
||||||
|
|
||||||
If there are updates to documentation web site, do not forget to publish it
|
## Documentation
|
||||||
|
|
||||||
|
If there are updates to documentation web site these should be published
|
Loading…
x
Reference in New Issue
Block a user