forked from notaryproject/notation
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.55 KB
/
dev-release.yml
File metadata and controls
52 lines (49 loc) · 1.55 KB
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
name: dev-release
on:
schedule:
- cron: '0 16 * * 0' # at 16:00 on Sunday (UTC)
workflow_dispatch:
jobs:
build:
name: Weekly Release Notation Binaries
runs-on: ubuntu-20.04
strategy:
matrix:
go-version: ['1.20']
fail-fast: true
steps:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Git User
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Create Version Tag
run: |
# get project version: <SemVer>.dev.<YYYYMMDD>
export TAG_VERSION=`cat ./internal/version/version.go | grep "Version = " | awk -F '"' '{print $2}'`.dev.`date +%Y%m%d`
# create new tag
git tag -af $TAG_VERSION -m "For weekly build"
git push origin $TAG_VERSION
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release -f ./.dev.goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete old dev release
uses: dev-drprasad/delete-older-releases@v0.2.1
with:
keep_latest: 1
delete_tag_pattern: ".dev."
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}