forked from OpenCatalogi/opencatalogi
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 2.16 KB
/
release-workflows.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Release Workflow
on: [push]
jobs:
release-managment:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
#Based on https://github.com/marketplace/actions/git-version
- name: Git Version
id: version
uses: codacy/[email protected]
with:
release-branch: main
- name: Extract repository description
id: repo-description
run: |
description=$(jq -r '.description' <(curl -s https://api.github.com/repos/${{ github.repository }}))
echo "REPO_DESCRIPTION=$description" >> $GITHUB_ENV
#https://github.com/saadmk11/changelog-ci
- name: Run Changelog CI
uses: saadmk11/[email protected]
with:
release_version: ${{ steps.version.outputs.version }}
config_file: changelog-ci-config.json
- name: Commit and push updated info.xml and changelog.md
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add changelog.md
git commit -m "Update version and summary in info.xml to ${{ steps.version.outputs.version }}"
git push origin ${{ github.head_ref }}
- name: Use the version
run: |
echo ${{ steps.version.outputs.version }}
#https://github.com/marketplace/actions/zip-release
- name: Archive Release
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'release.zip'
exclusions: '*.git* /*node_modules/* .editorconfig'
#https://github.com/marvinpinto/action-automatic-releases
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.version.outputs.version }}
prerelease: false
title: "Release ${{ steps.version.outputs.version }}"
files: |
LICENSE.md
release.zip