-
Notifications
You must be signed in to change notification settings - Fork 14
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
5 changed files
with
146 additions
and
31 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
name: Build and Release on Linux | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: [ created ] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: uwpr/comet | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Comet | ||
run: make && ./comet.exe -p | ||
|
||
- name: Prepare release | ||
run: | | ||
mkdir release && \ | ||
cp comet.exe release/comet && \ | ||
cp README.md release/README.md && \ | ||
tar -czv linux.tar.gz release | ||
- name: Upload binaries to the release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: ${{ github.event_name == 'release' }} | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: linux.tar.gz | ||
overwrite: true | ||
|
||
- name: Extract metadata for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Log in to the GitHub Container registry | ||
if: ${{ github.event_name == 'release' }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ github.event_name == 'release' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Test the Docker image | ||
if: ${{ github.event_name != 'release' }} | ||
run: docker run ${REGISTRY}/${{ env.IMAGE_NAME }}:main comet -p |
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,33 @@ | ||
name: Build and Release on MacOS | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Comet | ||
run: make && ./comet.exe -p | ||
|
||
- name: Prepare release | ||
run: | | ||
mkdir release && \ | ||
cp comet.exe release/comet && \ | ||
cp README.md release/README.md && \ | ||
zip -r macos.zip release | ||
- name: Upload binaries to the release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: ${{ github.event_name == 'release' }} | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: macos.zip | ||
overwrite: true |
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,39 @@ | ||
name: Build and Release on Windows | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup msbuild | ||
uses: microsoft/setup-msbuild@v1.1 | ||
|
||
- name: Build Comet | ||
run: | | ||
msbuild Comet.sln -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=v142 -tv:Current | ||
- name: Prepare release | ||
shell: bash | ||
run: | | ||
mkdir release && \ | ||
cp comet.exe release/comet.exe && \ | ||
cp README.md release/README.md && \ | ||
zip -r windows.zip release | ||
- name: Upload binaries to the release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: ${{ github.event_name == 'release' }} | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: windows.zip | ||
overwrite: true |
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,11 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install procps -y && \ | ||
apt-get clean | ||
|
||
WORKDIR /app | ||
|
||
COPY comet.exe ./comet | ||
|
||
ENV PATH="/app:$PATH" |