-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (101 loc) · 3.24 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
99
100
101
102
103
104
105
name: release
on:
push:
tags:
- '*'
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ssh-sync:latest
build-windows:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.19.7"
-
name: Go Build
run: go build -o ./win-build/ssh-sync.exe -ldflags "-X main.version=${{github.ref_name}}"
shell: powershell
-
name: Inno Build
run: |
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" /dMyAppVersion="${{github.ref_name}}" "$env:GITHUB_WORKSPACE\win-build\setup.iss"
shell: powershell
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: ssh-sync-setup
path: ./win-build/Output/ssh-sync-setup.exe
retention-days: 5
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.19.7"
- name: Go Build
run: go build -o ssh-sync -ldflags "-X main.version=${{github.ref_name}}"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ssh-sync
path: ./ssh-sync
retention-days: 5
release:
needs: [build-docker, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- uses: ncipollo/release-action@v1
with:
artifacts: "./ssh-sync-setup/ssh-sync-setup.exe,./ssh-sync/ssh-sync"
update-winget-manifest:
needs: [build-docker, build-windows, build-linux, release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: tgymnich/fork-sync@v1.8
with:
owner: therealpaulgg
repo: winget-pkgs
base: master
head: master
- name: Install winget
uses: Cyberboss/install-winget@v1
- name: Install wingetcreate
run: winget install --id=Microsoft.WingetCreate --exact --accept-package-agreements --accept-source-agreements
- name: Update winget manifest
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
$tag = "${{ github.ref_name }}"
wingetcreate update therealpaulgg.ssh-sync --version $tag --token "$env:ACCESS_TOKEN" -u https://github.com/therealpaulgg/ssh-sync/releases/download/$tag/ssh-sync-setup.exe --submit
shell: powershell