-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (59 loc) · 1.72 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
name: 'Release'
permissions: write-all
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
type: string
required: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
version_tag: ${{ steps.version_tag.outputs.value }}
build_date: ${{ steps.build_date.outputs.value }}
steps:
- name: Format version tag
shell: bash
id: version_tag
env:
INPUT_TAG: ${{ github.event.inputs.version }}
run: |
TAG=${INPUT_TAG#v}
echo "::set-output name=value::v$TAG"
- name: Build date
shell: bash
id: build_date
run: echo "::set-output name=value::$(date +%FT%T%z)"
release:
needs:
- prepare
runs-on: ubuntu-latest
env:
VERSION_TAG: ${{ needs.prepare.outputs.version_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Setup Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Create tag
run: |
git tag -d "$VERSION_TAG" 2> /dev/null || echo "Release tag '$VERSION_TAG' does NOT exist"
git tag --annotate --message "kyberswap-dex-lib $VERSION_TAG" "$VERSION_TAG"
git push origin "refs/tags/$VERSION_TAG"
- name: Create release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.VERSION_TAG }}
prerelease: false
name: "ETHRPC ${{ env.VERSION_TAG }}"