-
Notifications
You must be signed in to change notification settings - Fork 17
98 lines (80 loc) · 2.4 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release
on:
push:
tags:
- '*'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GITHUB_ACTIONS_NAME: "github-actions[bot]"
GITHUB_ACTIONS_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
permissions: write-all
jobs:
build_tran:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 16
- name: Set up GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
install-only: true
- name: Set up Task
uses: arduino/setup-task@v1
- name: Set up Tag
id: ghtag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Set up Date
run: go run ./scripts/date.go >> date.txt
- name: Build
run: BuildDate="$(cat date.txt)" goreleaser release --rm-dist --timeout 100m
- name: Build `gh-tran`
env:
TAG: ${{ steps.ghtag.outputs.tag }}
run: |
DATE="$(cat date.txt)"
gh repo clone abdfnx/gh-tran
cd gh-tran
./release.sh $TAG $DATE
cd ../scripts/gh-tran
yarn
cd ../..
task ght
- name: Commit files
env:
TAG: ${{ steps.ghtag.outputs.tag }}
run: |
cd ./scripts/gh-tran/tmp/gh-tran
git config --local user.email "${{ env.GITHUB_ACTIONS_EMAIL }}"
git config --local user.name "${{ env.GITHUB_ACTIONS_NAME }}"
git diff --cached
git add .
git commit -m "tran ${TAG}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
repository: "abdfnx/gh-tran"
github_token: ${{ secrets.ACCESS_TOKEN }}
directory: ./scripts/gh-tran/tmp/gh-tran
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build tran from Docker
run: |
task build
cp tran ./docker/vm
- name: Build Tran Containers
run: |
task build-tran-container
task build-tran-full-container