Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create release Workflow #8966

Closed
wants to merge 5 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# This is a basic workflow that is manually triggered

name: Release Workflow

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to use to do the release e.g. 2022.02.xx (YYYY.XX.xx)'
required: true
version:
description: 'Version to release, e.g. 2022.02.01. (YYYY.XX.mm)'
required: true
previousVersion:
description: 'Previous release version number (needed to generate proper changelog e.g. 2022.02.00) (YYYY.XX.mm)'
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
############
offtherailz marked this conversation as resolved.
Show resolved Hide resolved
# Build
##########
- 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.event.inputs.branch }}
tag_name: "v${{ github.event.inputs.version }}"
release_name: "v${{ github.event.inputs.version }}"
body: |
## [${{ github.event.inputs.version }}](https://github.com/geosolutions-it/MapStore2/tree/v${{ github.event.inputs.version }}) (${{ steps.date.outputs.date }})

- **[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)**
offtherailz marked this conversation as resolved.
Show resolved Hide resolved
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