-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.1 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
name: Automated Release with Archive
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag Name for Release (leave empty for last tag)'
required: false
default: ''
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Determine tag
id: last_tag
run: |
echo "LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
- name: Create archive
run: |
if [ -z "${{ github.event.inputs.tag }}" ]; then
TAG_NAME=${{ env.LAST_TAG }}
else
TAG_NAME=${{ github.event.inputs.tag }}
fi
zip -r ${TAG_NAME}.zip .
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.LAST_TAG }}
name: Release ${{ env.LAST_TAG }}
files: ./.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}