Skip to content

Commit

Permalink
Release Automation Process (geosolutions-it#9555)
Browse files Browse the repository at this point in the history
* Add actions

* Updated workflows for deprecations and security

* Fixed changelog stuff

* renamed release workflow file

* Fixed concurrency

* Separated release steps

* Update for uniformity the scripts. Fixed wrong java modules set

* Fixed wrong version system in binary

* Fixed version update script

* Updated documentation. Last fixes

* Removed file committed in error

* Improved docs

* Improved docs

* Improved docs

* Minor fixes to doc

* Fixed release procedure missing paragraph

* Update procedure for linking latest stable doc

* Update release_steps.md

* Update .github/ISSUE_TEMPLATE/release_steps.md

* Apply suggestions from code review

Co-authored-by: Matteo V. <[email protected]>

---------

Co-authored-by: Matteo V. <[email protected]>
  • Loading branch information
offtherailz and MV88 authored Mar 4, 2024
1 parent f312509 commit 39e9019
Show file tree
Hide file tree
Showing 9 changed files with 628 additions and 57 deletions.
83 changes: 46 additions & 37 deletions .github/ISSUE_TEMPLATE/release_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,24 @@ This steps have to be followed always when preparing a new release.

## New stable branch creation

If stable release (YYYY.XX.00) follow these sub-steps:

- [ ] create a branch `YYYY.XX.xx` from master branch (`xx` is really `xx`, example: 2018.01.xx). This is the new **stable branch**
- [ ] Change [MapStore2-QA-Build](http://build.geosolutionsgroup.com/view/MapStore/job/MapStore/view/MapStore%20QA/job/MapStore2-QA-Build/) by updating the `branch` parameter in the build configuration page to `YYYY.XX.xx`
- [ ] on MapStore **stable branch**
- [ ] Fix `pom.xml` files to make sure that no `-SNAPSHOT` **dependencies** are used anymore.
- [ ] on MapStore **master branch**
- [ ] increase version of java modules. (`mvn versions:set -DnewVersion=<SNAPSHOT_VERSION> -DprocessAllModules -DgenerateBackupPoms=false`). Where `<SNAPSHOT_VERSION>` increases the major number. (e.g. `1.3-SNAPSHOT` --> `1.4-SNAPSHOT`)
- [ ] Manually update project pom templates to use `mapstore-services` of `<SNAPSHOT_VERSION>` to the new one. (`projects/templates/web/pom.xml`).
- [ ] Increment version of `package.json` on master **0.&lt;x-incremented&gt;.0** with the command `npm version minor --git-tag-version=false`
**Only** if you need to create a new stable major release (YYYY.XX.00), you need to create a branch for it. Check the following:

- [ ] Run the [`Cut Release Branch`](https://github.com/geosolutions-it/MapStore2/actions/workflows/cut_major_branch.yml) workflow on github.
With the following Parameters:

- [ ] Use workflow from branch `master`
- [ ] MapStore branch name to use: `YYYY.XX.xx`
- [ ] Version of *MapFish Print*, *GeoStore* and *HTTP-Proxy* accordingly to the [MapStore release calendar](https://github.com/geosolutions-it/MapStore2/wiki/MapStore-Release-Calendars)
- [ ] use the default value for the other parameters
- [ ] Wait for the process to complete. At the end:
- A Pull request will be created to the master
- A new branch named `YYYY.XX.xx` with fixed versions
- [ ] Merge the incoming PR created by the workflow
- [ ] Create on [ReadTheDocs](https://readthedocs.org/projects/mapstore/) project the version build for `YYYY.XX.xx` (click on "Versions" and activate the version of the branch)
- [ ] create a branch with the same name (`YYYY.XX.xx`) in [MapStoreExtension](https://github.com/geosolutions-it/MapStoreExtension) repository.
- [ ] Run the [`Cut Release Branch`](https://github.com/geosolutions-it/MapStoreExtension/actions/workflows/cut_release_branch.yml) workflow on MapStoreExtension project, indicating:
- [ ] Use workflow from branch `master`
- [ ] MapStore branch name to use: `YYYY.XX.xx`
- [ ] main branch `master` (default)

## Before the Release

Expand All @@ -48,14 +54,18 @@ If stable release (YYYY.XX.00) follow these sub-steps:
- [ ] `npm run start:app`, then check that an empty homepage loads correctly
- [ ] Test [Binary](http://build.geosolutionsgroup.com/view/MapStore/job/MapStore/view/MapStore%20QA/job/MapStore2-QA-Build/) (take the mapstore2-<RELEASE_BRANCH>-qa-bin.zip, from latest build)

## Release
## Prepare Release

- [ ] On **stable** branch, do and merge a PR for updating:
- [ ] Update `CHANGELOG.md` [Instructions](https://mapstore.readthedocs.io/en/latest/developer-guide/release/#changelog-generation)
- [ ] Update the version of java modules on the stable branch to a stable, incremental version. Run `mvn versions:set -DnewVersion=<SNAPSHOT_VERSION> -DprocessAllModules -DgenerateBackupPoms=false` to update package version, where `<VERSION>` is the version of the java packages (e.g. `1.3.1`). (`mvn:release:prepare` may also work. TODO: check this command)
- [ ] Manually update project pom templates to use `mapstore-services` of `<VERSION>`. `project/standard/templates/web/pom.xml`
- [ ] on **master branch** do and merge a PR for updating:
- [ ] Update `CHANGELOG.md` [Instructions](https://mapstore.readthedocs.io/en/latest/developer-guide/release/#changelog-generation)
- [ ] Run [`Prepare Release`](https://github.com/geosolutions-it/MapStore2/actions/workflows/pre_release.yml) workflow on github actions with the following parameters:
- Use workflow from `branch` **YYYY.XX.xx** (the release branch)
- Version to release **YYYY.XX.mm** (the effective number of the release)
- MapStore version for changelog generation **YYYY.XX.mm** (the effective number of the previous release)
- version to fix for the java module, accordingly with release schedule (e.g. `1.7.0`)
- use the default value for the other parameters
- [ ] Wait for the process to complete. At the end:
- a new commit will be added to the release branch tagged as `vYYYY.XX.mm`. This commit will contain the changelog and the updated version of the java modules.
- a pull request will be created on master with the changelog updates
- [ ] Merge the incoming PR created by the workflow for updating changelog on Master

## MapStore Stable deploy

Expand All @@ -70,28 +80,27 @@ If stable release (YYYY.XX.00) follow these sub-steps:
- [ ] After "MapStore2-Stable-Build" finished, Launch [MapStore2-Stable-Deploy](http://build.geosolutionsgroup.com/view/MapStore/job/MapStore/view/MapStore%20Stable/job/MapStore2-Stable-Deploy/) to install the latest stable version on official demo
- [ ] test the change has been applied, login on https://mapstore.geosolutionsgroup.com and verify that the layers from `gs-stable` are visible without errors (typically authentication errors that was caused by the wrong auth-key).


## Build and publishing release

- [ ] Create a [github draft release](https://github.com/geosolutions-it/MapStore2/releases)
- [ ] `branch` **YYYY.XX.xx**
- [ ] `tag` **vYYYY.XX.mm** (create a new tag from UI after entering this value)
- [ ] `release` name equal to tag **vYYYY.XX.mm**
- [ ] `description` describe the major changes and add links of the Changelog paragraph.
- [ ] Launch [MapStore2-Stable-Releaser](http://build.geosolutionsgroup.com/view/MapStore/job/MapStore/view/MapStore%20Stable/job/MapStore2-Stable-Releaser/) Jenkins job with **YYYY.XX.mm** for the version and **YYYY.XX.xx** for the branch to build and **wait the end**. **Note:** Using the MapStore2 Releaser allows to write the correct version number into the binary packages. In the overview of this job you can find and download :
- [ ] the latest `mapstore.war`
- [ ] the latest binary `mapstore2-YYYY.XX.mm-bin.zip`
- [ ] the printing bundle `mapstore-printing.zip`
- [ ] Upload to draft release
- [ ] the updated binary `mapstore2-YYYY.XX.mm-bin.zip`
- [ ] the `mapstore.war` package
- [ ] `mapstore-printing.zip` on github release
- [ ] Run [`Create Release`](https://github.com/geosolutions-it/MapStore2/actions/workflows/create_release.yml) workflow on github actions with the following parameters:
- Use workflow from `branch` **YYYY.XX.xx** (the release branch)
- Version to release **YYYY.XX.mm** (the effective number of the release)
- [ ] Launch [MapStore2-Stable-Releaser](http://build.geosolutionsgroup.com/view/MapStore/job/MapStore/view/MapStore%20Stable/job/MapStore2-Stable-Releaser/) Jenkins job with
- **YYYY.XX.mm** for the version
- **YYYY.XX.xx** for the branch to build
- [ ] Wait the end of the 2 process

When the processes are finished, the release is ready to be published on github in draft mode.

- [ ] Open the new release in draft from [here](https://github.com/geosolutions-it/MapStore2/releases)
- [ ] Update the link to Docker in the release notes with the link to the latest stable release (search the new tag on [docker hub](https://hub.docker.com/r/geosolutionsit/mapstore2/tags) )
- [ ] Update the description of the release details
- [ ] Publish the release
- [ ] create on [ReadTheDocs](https://readthedocs.org/projects/mapstore/) project the version build for `vYYYY.XX.mm` (click on "Versions" and activate the version of the tag, created when release was published)
- [ ] Update `Default version` to point the release version in the `Advanced Settings` menu of the [ReadTheDocs](https://readthedocs.org/dashboard/mapstore/advanced/) admin panel


## Build and publish MapStoreExtension release

- [ ] [Create a draft release](https://github.com/geosolutions-it/MapStoreExtension/releases/new) for [MapstoreExtension](https://github.com/geosolutions-it/MapStoreExtension) with the same name and tag
- [ ] target of the release is **stable branch** aligned to latest commit in stable branch of main mapstore repo
- [ ] tag is **vYYYY.XX.mm**
Expand All @@ -103,10 +112,10 @@ If stable release (YYYY.XX.00) follow these sub-steps:
- [ ] Link the MapStore extension release in the MapStore release

## Finalize Release
- [ ] Prepare a PR MapStore **stable branch** **YYYY.XX.xx** in order to :
- [ ] reset versions of java modules to `-SNAPSHOT` (`mvn versions:set -DnewVersion=<SNAPSHOT_VERSION> -DprocessAllModules -DgenerateBackupPoms=false`) where `<SNAPSHOT_VERSION>` is the version to set. (e.g. `1.2-SNAPSHOT`).
- [ ] Manually update project pom templates to use `mapstore-services` of `<SNAPSHOT_VERSION>`. `project/standard/templates/web/pom.xml`
- [ ] on `package.json` increasing the minor "version" number. **0.x.&lt;number-of-minor-version&gt;**

- [ ] Run the [`Post Release`](https://github.com/geosolutions-it/MapStore2/actions/workflows/post_release.yml) workflow on github with the following parameters:
- Use workflow from branch `YYYY.XX.xx` (the release branch)
- Version of Java Packages to restore accordingly with release calendar with `-SNAPSHOT` E.g. `1.7-SNAPSHOT`
- [ ] Write to the mailing list about the current release news and the next release major changes
- [ ] Optional - prepare a PR for updating release procedure, if needed
- [ ] Close this issue
Expand Down
152 changes: 152 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Create Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release. (format: `YYYY.MM.mm`)'
required: true
jobs:
################
# Build
################
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
################
# Protect master branch
################
- name: Check branch
if: ${{ github.repository != 'geosolutions-it/MapStore2' || github.ref == 'master' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('This workflow can not run on master branch')
- uses: actions/checkout@v3
- name: "checking out"
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: "setting up npm"
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: "setting up Java"
uses: actions/setup-java@v1
with:
java-version: '11.x'
############
# CACHING
##########
- name: "cache node modules"
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: "cache maven dependencies"
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: mapstore-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
mapstore-${{ runner.os }}-maven-
- name: Build
id: "build"
run: "./build.sh ${{ github.event.inputs.version }} binary,printingbundle"
- name: "Upload war"
uses: actions/upload-artifact@v3
with:
name: war
path: product/target/mapstore.war
- name: "Upload binary"
uses: actions/upload-artifact@v3
with:
name: binary
path: "binary/target/mapstore2-${{ github.event.inputs.version }}-bin.zip"
- name: "Upload printing"
uses: actions/upload-artifact@v3
with:
name: printing
path: "java/printing/target/mapstore-printing.zip"
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: "Download war"
uses: actions/download-artifact@v3
with:
path: artifacts/
- name: Display structure of downloaded files
run: ls -R
working-directory: artifacts
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: create_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:
commitish: ${{ github.ref }}
tag_name: "v${{ github.event.inputs.version }}"
release_name: "v${{ github.event.inputs.version }}"
body: |
## Main Features
- ...
## Main Improvements
- ...
## Useful links related to **[v${{ github.event.inputs.version }}](https://github.com/geosolutions-it/MapStore2/tree/v${{ github.event.inputs.version }})**
- **[Full Changelog](https://github.com/geosolutions-it/MapStore2/compare/v${{ github.event.inputs.previousVersion }}...v${{ github.event.inputs.version }})**
- **[Implemented enhancements](https://github.com/geosolutions-it/MapStore2/issues?q=is%3Aissue+milestone%3A%22${{ github.event.inputs.version }}%22+is%3Aclosed+label%3Aenhancement)**
- **[Fixed bugs](https://github.com/geosolutions-it/MapStore2/issues?q=is%3Aissue+milestone%3A%22${{ github.event.inputs.version }}%22+is%3Aclosed+label%3Abug)**
- **[Closed issues](https://github.com/geosolutions-it/MapStore2/issues?q=is%3Aissue+milestone%3A%22${{ github.event.inputs.version }}%22+is%3Aclosed)**
- **[MapStore Extension release v${{ github.event.inputs.version }}](https://github.com/geosolutions-it/MapStoreExtension/releases/tag/v${{ github.event.inputs.version }})**
- **[Docker image v${{ github.event.inputs.version }}](xxx)** `< TODO: add this link manually`
- **[MapStore documentation v${{ github.event.inputs.version }}](https://docs.mapstore.geosolutionsgroup.com/en/v${{ github.event.inputs.version }}/)**
draft: true
prerelease: false
- name: Upload Release war
id: upload-release-war
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/war/mapstore.war
asset_name: mapstore.war
asset_content_type: application/zip
- name: Upload Release binary
id: upload-release-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: "artifacts/binary/mapstore2-${{github.event.inputs.version}}-bin.zip"
asset_name: "mapstore2-${{github.event.inputs.version}}-bin.zip"
asset_content_type: application/zip
- name: Upload Release printing
id: upload-release-printing
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/printing/mapstore-printing.zip
asset_name: mapstore-printing.zip
asset_content_type: application/zip
Loading

0 comments on commit 39e9019

Please sign in to comment.