-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
383 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
# mkdir -p .debpkg/usr/bin | ||
# mkdir -p .debpkg/usr/lib/egpu-switcher | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
|
||
version=$1 | ||
checksum=$2 | ||
|
||
#### egpu-switcher #### | ||
|
||
mkdir -p ./.pkgbuild/egpu-switcher | ||
cp ./.pkg/aur/egpu-switcher/* ./.pkgbuild/egpu-switcher | ||
|
||
cat << EOF > ./.pkgbuild/egpu-switcher/PKGBUILD | ||
# Maintainer: hertg <[email protected]> | ||
# This file is generated automatically | ||
_version=$version | ||
_versionWithoutPrefix=${version#v} | ||
_pkgname=egpu-switcher | ||
_pkgver=$(echo $version | sed 's/\([^-]*-g\)/r\1/;s/-/./g') | ||
_source=\${_pkgname}-\${_version}::https://github.com/hertg/egpu-switcher/archive/refs/tags/$version.tar.gz | ||
EOF | ||
|
||
cat ./.pkgbuild/egpu-switcher/PKGBUILD.template >> ./.pkgbuild/egpu-switcher/PKGBUILD | ||
rm ./.pkgbuild/egpu-switcher/PKGBUILD.template | ||
|
||
|
||
#### egpu-switcher-bin #### | ||
|
||
mkdir -p ./.pkgbuild/egpu-switcher-bin | ||
cp ./.pkg/aur/egpu-switcher-bin/* ./.pkgbuild/egpu-switcher-bin | ||
|
||
cat << EOF > ./.pkgbuild/egpu-switcher-bin/PKGBUILD | ||
# Maintainer: hertg <[email protected]> | ||
# This file is generated automatically | ||
_version=$version | ||
_pkgname=egpu-switcher-bin | ||
_pkgver=$(echo $version | sed 's/\([^-]*-g\)/r\1/;s/-/./g') | ||
_sha256sum=$checksum | ||
_source=\${_pkgname}-\${_pkgver}::https://github.com/hertg/egpu-switcher/releases/download/$version/egpu-switcher-amd64 | ||
EOF | ||
|
||
cat ./.pkgbuild/egpu-switcher-bin/PKGBUILD.template >> ./.pkgbuild/egpu-switcher-bin/PKGBUILD | ||
rm ./.pkgbuild/egpu-switcher-bin/PKGBUILD.template | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# reusable workflow | ||
name: Publish to AUR | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
secrets: | ||
AUR_USERNAME: | ||
required: true | ||
AUR_EMAIL: | ||
required: true | ||
AUR_PRIVATE_KEY: | ||
required: true | ||
|
||
jobs: | ||
pkgbuild: | ||
runs-on: ubuntu-latest | ||
name: Generate AUR PKGBUILD | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: egpu-switcher-amd64 | ||
path: ./download | ||
|
||
- name: Export Checksum | ||
run: echo "SHA256=$(cat ./download/sha256sum.txt | cut -d' ' -f1)" >> $GITHUB_ENV | ||
|
||
- name: Generate PKGBUILDs | ||
run: ./.ci/generate-pkgbuild.sh ${{ inputs.version }} ${{ env.SHA256 }} | ||
|
||
- name: Upload egpu-switcher PKGBUILD | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: egpu-switcher-PKGBUILD | ||
path: ./.pkgbuild/egpu-switcher/* | ||
|
||
- name: Upload egpu-switcher-bin PKGBUILD | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: egpu-switcher-bin-PKGBUILD | ||
path: ./.pkgbuild/egpu-switcher-bin/* | ||
|
||
- name: Publish egpu-switcher | ||
uses: KSXGitHub/[email protected] | ||
with: | ||
pkgname: egpu-switcher | ||
pkgbuild: ./.pkgbuild/egpu-switcher/PKGBUILD | ||
force_push: true | ||
commit_username: ${{ secrets.AUR_USERNAME }} | ||
commit_email: ${{ secrets.AUR_EMAIL }} | ||
ssh_private_key: ${{ secrets.AUR_PRIVATE_KEY }} | ||
commit_message: New release via github actions | ||
|
||
- name: Publish egpu-switcher-bin | ||
uses: KSXGitHub/[email protected] | ||
with: | ||
pkgname: egpu-switcher-bin | ||
pkgbuild: ./.pkgbuild/egpu-switcher-bin/PKGBUILD | ||
force_push: true | ||
commit_username: ${{ secrets.AUR_USERNAME }} | ||
commit_email: ${{ secrets.AUR_EMAIL }} | ||
ssh_private_key: ${{ secrets.AUR_PRIVATE_KEY }} | ||
commit_message: New release via github actions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# reusable workflow | ||
name: Create Github Release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
binary: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
name: Release ${{ inputs.binary }} | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.binary }} | ||
path: ./download | ||
|
||
- name: Create Github Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: false | ||
files: download/${{ inputs.binary }} | ||
prerelease: ${{ contains(github.ref, '-rc.') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# reusable workflow | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
go-version: | ||
required: true | ||
type: string | ||
go-arch: | ||
required: true | ||
type: string | ||
filename: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Run build (Go ${{ inputs.go-version }}) | ||
env: | ||
GOARCH: ${{ inputs.go-arch }} | ||
BINARY_NAME: ${{ format('{0}-{1}', inputs.filename, inputs.go-arch) }} | ||
ORIGIN: gh | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# without that 'git describe --tags' may result | ||
# in 'fatal: No names found, cannot describe anything.' | ||
# see https://stackoverflow.com/a/71721059/2726733 | ||
fetch-depth: 0 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
cache: true | ||
|
||
- name: Run build | ||
run: make build | ||
|
||
- name: Create SHA256 Checksum | ||
run: sha256sum ./bin/${{ env.BINARY_NAME }} > ./bin/sha256sum.txt || exit $? | ||
|
||
- name: Upload binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.BINARY_NAME }} | ||
path: ./bin/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# reusable workflow | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
go-version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Run tests (Go ${{ inputs.go-version }}) | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
cache: true | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
name: Run linters (Go ${{ inputs.go-version }}) | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
cache: true | ||
|
||
- name: Run linters | ||
run: make lint | ||
|
Oops, something went wrong.