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

Build/semantic release #16

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release

on:
workflow_dispatch:
inputs:
release-dryrun:
description: simulate release
required: true
type: boolean

concurrency:
# only run one publishing at a time to avoid conflicts
group: publish-${{ github.ref }}

env:
# renovate: datasource=npm depName=@semantic-release/changelog
SEMANTIC_RELEASE_CHANGELOG_VERSION: 6.0.3

# renovate: datasource=npm depName=@semantic-release/exec
SEMANTIC_RELEASE_EXEC_VERSION: 6.0.3

# renovate: datasource=npm depName=@semantic-release/git
SEMANTIC_RELEASE_GIT_VERSION: 10.0.1

# renovate: datasource=npm depName=conventional-changelog-conventionalcommits
CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION: 7.0.2

jobs:
release:
name: Release
runs-on: ubuntu-latest

outputs:
release-published: ${{ steps.release.outputs.new_release_published }}
release-version: ${{ steps.release.outputs.new_release_version }}

steps:
- name: Determine app token for release
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
id: app-token
with:
app-id: ${{ secrets.WE_RELEASE_GITHUB_APP_ID }}
private-key: ${{ secrets.WE_RELEASE_GITHUB_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: ${{ steps.app-token.outputs.token }}
# Note: special permissions for push to protected branch required
# Credentials required for semantic-release-github-actions-tags
# persist-credentials: false

- name: Install NodeJs
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20

- name: Setup Java
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
with:
distribution: temurin
java-version: 17

- name: Release
id: release
uses: cycjimmy/semantic-release-action@cb425203a562475bca039ba4dbf90c7f9ac790f4 # v4.1.0
env:
# Permissions needed
# contents: write
# issues: write
# pull-requests: write
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GIT_AUTHOR_NAME: wetransform Bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: wetransform Bot
GIT_COMMITTER_EMAIL: [email protected]
RUNNER_DEBUG: 1
with:
dry_run: ${{ inputs.release-dryrun }}
semantic_version: 23.1.1

extra_plugins:
"@semantic-release/changelog@\
${{ env.SEMANTIC_RELEASE_CHANGELOG_VERSION }} \
@semantic-release/exec@\
${{ env.SEMANTIC_RELEASE_EXEC_VERSION }} \
@semantic-release/git@\
${{ env.SEMANTIC_RELEASE_GIT_VERSION }} \
conventional-changelog-conventionalcommits@\
${{ env.CONVENTIONAL_CHANGELOG_CONVENTIONALCOMMITS_VERSION }} \
"
27 changes: 27 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
branches:
- master

plugins:
- - "@semantic-release/commit-analyzer"
# see https://github.com/semantic-release/commit-analyzer?tab=readme-ov-file#options
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
# see https://github.com/semantic-release/release-notes-generator?tab=readme-ov-file#options
- preset: conventionalcommits
presetConfig:
issuePrefixes: ['WGS-']
issueUrlFormat: 'https://wetransform.atlassian.net/servicedesk/customer/portal/1/{{prefix}}{{id}}'
parserOpts:
# https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#referenceactions
# set to null to reference an issue without action (but will still show it "closes" the issue in the changelog)
# referenceActions: null
- "@semantic-release/changelog"
- - "@semantic-release/exec"
- prepareCmd: bash -c "rm -rf ./build/distributions && ./gradlew assembleDist"
- - "@semantic-release/git"
- assets:
- CHANGELOG.md
- - "@semantic-release/github"
- assets:
- build/distributions/*
7 changes: 7 additions & 0 deletions .wetf-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Repository configuration for wetransform managed repositories

# Reference presets that should apply to this repository
presets:
- renovate # renovate workflow
- renovate-config # managed renovate config
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ buildscript {

import java.text.*

plugins {
id 'distribution'
}

apply plugin: 'to.wetransform.hale'

hale {
Expand Down Expand Up @@ -850,6 +854,33 @@ def reporter = new BuildReporter(project: project)
gradle.addListener( (TaskExecutionListener) reporter)
gradle.addListener( (BuildListener) reporter)

distributions {
main {
distributionBaseName = 'postnas-inspire-alignments'
contents {
from('.') {
include '*'
include 'gradle/**'
include 'buildSrc/**'
include 'adv-alignments/**'
include 'profiles/**'
include 'projects/**'
include 'database/**'
exclude '.git'
exclude '.github'
exclude '.gitignore'
exclude '.gradle'
exclude '.releaserc.yml'
exclude '.vscode'
exclude '.wetf-repo.yml'
exclude '*.log'
exclude 'gradle.properties'
exclude 'build/**'
exclude 'workspace'
}
}
}
}

wrapper {
gradleVersion = '8.10.1'
Expand Down
Loading