Weekly releases #205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Weekly releases | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 4 * * 3' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: ['1.0', '1.1', '1.2', '1.3', '2.0'] | |
name: Weekly release "v${{matrix.version}}" | |
steps: | |
- name: Checkout specific branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
ref: 'release/${{matrix.version}}' | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: Semantic Versioning | |
if: ${{matrix.version != '2.0'}} | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
npx lerna version patch --exact --no-push --yes | |
- name: Semantic Versioning | |
if: ${{matrix.version == '2.0'}} | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
npx lerna version prerelease --exact --no-push --yes | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'release/${{matrix.version}}' | |
- name: Delete tag | |
continue-on-error: true | |
run: | | |
git push --delete origin v${{fromJson(steps.lerna.outputs.lernaJson).version}} | |
- name: Read Lerna | |
id: lerna | |
run: | | |
content=`cat ./lerna.json | tr -d "\n"` | |
echo "::set-output name=lernaJson::$content" | |
- name: Create PreRelease | |
uses: actions/create-release@v1.1.4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: 'You can find more details about the changes here: https://github.com/leanupjs/leanup/blob/master/CHANGELOG.md#${{fromJson(steps.lerna.outputs.lernaJson).version}}' | |
draft: false | |
prerelease: false | |
commitish: 'release/${{matrix.version}}' | |
release_name: Release ${{fromJson(steps.lerna.outputs.lernaJson).version}} | |
tag_name: ${{fromJson(steps.lerna.outputs.lernaJson).version}} |