Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): artifacts & docker image #169

Merged
merged 1 commit into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions .github/workflows/build.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Main

on:
push:
Expand Down Expand Up @@ -166,13 +166,19 @@ jobs:
needs: [ build-windows, build-macos, build-linux ]
if: startsWith(github.ref, 'refs/tags/') && (github.event.base_ref == 'refs/heads/prod' || github.event.base_ref == 'refs/heads/dev')
steps:
- name: Check out files
uses: actions/checkout@v4

- name: Download Binaries
uses: actions/[email protected]
with:
name: windows-x64-release
uses: actions/download-artifact@v3

- name: Compress Binaries
run: |
for dir in */; do
if [[ $dir == *"windows"* ]]; then
zip -r "${dir%/}.zip" "$dir"
else
tar -czvf "${dir%/}.tar.gz" "$dir"
fi
done
shell: bash

- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
Expand All @@ -181,4 +187,20 @@ jobs:
prerelease: false
draft: true
files: |
gsc-tool.exe
*.zip
*.tar.gz

- name: Checkout Dockerfile
uses: actions/checkout@v4
with:
sparse-checkout: |
Dockerfile
sparse-checkout-cone-mode: false

- name: Build and Publish Docker Image
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
image-name: gsc-tool
extract-git-tag: true
additional-image-tags: latest
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM alpine:3.19

# glibc compatibility
RUN apk add --no-cache gcompat libstdc++

# copy gsc-tool
COPY --chmod=755 gsc-tool /usr/local/bin/
COPY --chmod=755 ./linux-x64-release/gsc-tool /usr/local/bin/

ENTRYPOINT ["/usr/local/bin/gsc-tool"]
ENTRYPOINT ["/usr/local/bin/gsc-tool"]