-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (84 loc) · 3 KB
/
release-latest.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
name: Jupiter Layout Latest Build
env:
REGISTRY: ghcr.io
IMAGE_NAME: exampleserver-dev
on:
push:
branches:
- "main"
workflow_dispatch:
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go 1.19
uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Get dependencies
run: |
go env
go mod tidy -v
- name: Build exampleserver
run: |
CGO_ENABLED=0 go build -o ./cmd/exampleserver ./cmd/exampleserver
- name: image_name
run: echo ${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: mr-smithers-excellent/[email protected]
with:
registry: ${{ env.REGISTRY }}
image: ${{ env.IMAGE_NAME }}
addLatest: true
directory: ./cmd/exampleserver
dockerfile: ./cmd/exampleserver/Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: generate install.yml
run: |
make gen-dev-deployment
# Ignore the error when we delete the latest release, it might not exist.
- name: Delete the latest Release
continue-on-error: true
run: |
gh release delete latest --repo $GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}
# Ignore the error when we delete the latest tag, it might not exist.
- name: Delete the latest Tag
continue-on-error: true
run:
gh api --method DELETE /repos/$GITHUB_REPOSITORY/git/refs/tags/latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository_owner }}/${{ github.event.repository.name }}
- name: Recreate the latest Release and Tag
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: true
tag_name: latest
files: |
./deployment/install.yml
./deployment/install-mirror.yml
body: |
This is the "latest" release of **Jupiter-Layout**, which contains the most recent commits from the main branch.
This release **might not be stable**.
It is only intended for developers wishing to try out the latest features in Juno, some of which may not be fully implemented.