Skip to content

Commit

Permalink
feat(build): artifacts & docker image (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
xensik authored Jan 1, 2024
1 parent f367d19 commit 4806a28
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
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"]

0 comments on commit 4806a28

Please sign in to comment.