Skip to content

Commit

Permalink
gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cardinalby committed Mar 6, 2024
1 parent 98afee7 commit 03abf45
Show file tree
Hide file tree
Showing 30 changed files with 195 additions and 740 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: test

on:
push:
tags:
- "*.*.*"
workflow_dispatch:
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- run: go mod download
- run: go test ./...
- run: go generate ./...
- run: bash build.sh

- name: Create a Release
id: create_release
uses: shogo82148/actions-create-release@v1

- name: Upload Windows amd64 binary
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/windows_amd64/vlc-sync-play.exe
asset_name: vlc-sync-play_win_x64.exe
asset_content_type: application/vnd.microsoft.portable-executable

- name: Upload MacOS amd64 dmg
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/darwin_amd64/vlc-sync-play.dmg
asset_name: vlc-sync-play_intel.dmg
asset_content_type: application/x-apple-diskimage

- name: Upload MacOS arm64 dmg
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/darwin_arm64/vlc-sync-play.dmg
asset_name: vlc-sync-play_apple_silicon.dmg
asset_content_type: application/x-apple-diskimage

- name: Upload Linux x64 bin
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/linux_amd64/vlc-sync-play
asset_name: vlc-sync-play_linux_x64
asset_content_type: application/x-executable

- name: Upload Linux x64 deb
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/linux_amd64/vlc-sync-play.deb
asset_name: vlc-sync-play_linux_x64.deb
asset_content_type: application/vnd.debian.binary-package

- name: Upload Linux arm64 bin
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/linux_arm64/vlc-sync-play
asset_name: vlc-sync-play_linux_arm64
asset_content_type: application/x-executable

- name: Upload Linux arm64 deb
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/linux_arm64/vlc-sync-play.deb
asset_name: vlc-sync-play_linux_arm64.deb
asset_content_type: application/vnd.debian.binary-package
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test

on:
push:
branches:
- "**"
workflow_dispatch:
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v5

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- run: go mod download
- run: go test ./...
- run: bash build.sh
39 changes: 0 additions & 39 deletions Dockerfile

This file was deleted.

6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
SHELL = bash

go_generate:
go generate ./...

build:
cd build/cmd
go run .
go generate ./...
2 changes: 1 addition & 1 deletion assets/embded_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "embed"
var IconFS embed.FS

func GetTrayIcon() []byte {
data, err := IconFS.ReadFile("icons/tray_icon.png")
data, err := IconFS.ReadFile("generated/tray_icon.png")
if err != nil {
panic(err)
}
Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

bash ./go_generate.sh
#cd build/cmd || exit
#VLCSP_ROOT="../.." go run .
go install github.com/cardinalby/xgo-pack
xgo-pack build
101 changes: 0 additions & 101 deletions build/cmd/main.go

This file was deleted.

40 changes: 0 additions & 40 deletions build/cmd/path.go

This file was deleted.

47 changes: 0 additions & 47 deletions build/cmd/sub_cmd.go

This file was deleted.

21 changes: 0 additions & 21 deletions build/go.mod

This file was deleted.

Loading

0 comments on commit 03abf45

Please sign in to comment.