77
77
name : build-artifacts
78
78
path : electron/build/dist/build-artifacts/
79
79
80
- publish :
80
+ changelog :
81
81
needs : build
82
+ runs-on : ubuntu-latest
83
+ outputs :
84
+ BODY : ${{ steps.changelog.outputs.BODY }}
85
+ steps :
86
+ - name : Checkout
87
+ uses : actions/checkout@v2
88
+ with :
89
+ fetch-depth : 0 # To fetch all history for all branches and tags.
90
+
91
+ - name : Generate Changelog
92
+ id : changelog
93
+ run : |
94
+ export LATEST_TAG=$(git describe --abbrev=0)
95
+ export GIT_LOG=$(git log --pretty=" - %s [%h]" $LATEST_TAG..HEAD | sed 's/ *$//g')
96
+ export LATEST_TAG_WITH_LINK=$(echo "[$LATEST_TAG](https://github.com/arduino/arduino-pro-ide/releases/tag/$LATEST_TAG)")
97
+ if [ -z "$GIT_LOG" ]; then
98
+ export BODY="There were no changes since version $LATEST_TAG_WITH_LINK."
99
+ else
100
+ export BODY=$(echo -e "Changes since version $LATEST_TAG_WITH_LINK:\n$GIT_LOG")
101
+ fi
102
+ echo -e "$BODY"
103
+ OUTPUT_SAFE_BODY="${BODY//'%'/'%25'}"
104
+ OUTPUT_SAFE_BODY="${OUTPUT_SAFE_BODY//$'\n'/'%0A'}"
105
+ OUTPUT_SAFE_BODY="${OUTPUT_SAFE_BODY//$'\r'/'%0D'}"
106
+ echo "::set-output name=BODY::$OUTPUT_SAFE_BODY"
107
+ echo "$BODY" > CHANGELOG.txt
108
+
109
+ - name : Upload Changelog [GitHub Actions]
110
+ if : github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master')
111
+ uses : actions/upload-artifact@v2
112
+ with :
113
+ name : build-artifacts
114
+ path : CHANGELOG.txt
115
+
116
+ publish :
117
+ needs : changelog
82
118
if : github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master')
83
119
runs-on : ubuntu-latest
84
120
steps :
98
134
destination_dir : arduino-pro-ide/nightly/
99
135
100
136
release :
101
- needs : build
137
+ needs : changelog
102
138
if : startsWith(github.ref, 'refs/tags/')
103
139
runs-on : ubuntu-latest
104
140
steps :
@@ -108,21 +144,14 @@ jobs:
108
144
name : build-artifacts
109
145
path : build-artifacts
110
146
111
- - name : Create Release [GitHub]
112
- uses : actions/create-release@v1
113
- env :
114
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
115
- with :
116
- tag_name : ${{ github.ref }}
117
- release_name : ${{ github.ref }}
118
-
119
147
- name : Publish Release [GitHub]
120
148
uses : svenstaro/upload-release-action@v1-release
121
149
with :
122
150
repo_token : ${{ secrets.GITHUB_TOKEN }}
123
151
file : build-artifacts/*
124
152
tag : ${{ github.ref }}
125
153
file_glob : true
154
+ body : ${{ needs.changelog.outputs.BODY }}
126
155
127
156
- name : Publish Release [S3]
128
157
uses : kittaakos/upload-s3-action@v0.0.1
0 commit comments