-
-
Notifications
You must be signed in to change notification settings - Fork 92
84 lines (76 loc) · 2.59 KB
/
release.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Version bump, build and release
on:
workflow_dispatch:
jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Compile Master Boundary File
run: node compiler.js
- name: Upload Master Boundary File
uses: actions/upload-artifact@v4
with:
name: TRACONBoundaries
path: TRACONBoundaries.geojson
create_release:
needs: compile
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Download Master Boundary File
uses: actions/download-artifact@v4
with:
name: TRACONBoundaries
path: .
- name: Tag Version
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: patch
prefix: "v"
message: "Tag version to v${steps.tag_version.outputs.new_version}"
- name: Fetch all tags
run: git fetch --tags
- name: Generate Changelog
id: generate_changelog
run: |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
NEW_TAG=${{ steps.tag_version.outputs.new_version }}
if [ -z "$PREVIOUS_TAG" ]; then
echo "No previous tag found. Generating changelog from the beginning of the repository."
CHANGELOG=$(git log --pretty=format:"* %s (%an)")
else
echo "Previous tag: $PREVIOUS_TAG"
echo "New tag: $NEW_TAG"
CHANGELOG=$(git log $PREVIOUS_TAG..HEAD --pretty=format:"* %s (%an)")
fi
echo "$CHANGELOG" > CHANGELOG.md
shell: bash
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.tag_version.outputs.new_version }}
release_name: Release v${{ steps.tag_version.outputs.new_version }}
body_path: CHANGELOG.md
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./TRACONBoundaries.geojson
asset_name: TRACONBoundaries.geojson
asset_content_type: application/octet-stream