-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.35 KB
/
publish.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
name: Publish
on:
push:
branches: "main"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.2"
- name: Install Pandoc
run: sudo apt install -y pandoc
- name: Build Artifacts
run: make
- name: Build Documentation
run: make docs
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H%M%S')"
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.date.outputs.date }}',
sha: context.sha
})
- name: Create Release
uses: elgohr/Github-Release-Action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ steps.date.outputs.date }}
tag: ${{ steps.date.outputs.date }}
- name: Publish Assets to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.date.outputs.date }} ./build/2rm ./build/2rm.1