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

Release successful builds from github workflow #14

Open
nuIIpointerexception opened this issue Nov 24, 2024 · 1 comment
Open

Release successful builds from github workflow #14

nuIIpointerexception opened this issue Nov 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@nuIIpointerexception
Copy link

Add releasing in workflows

My main motivation for this is because i am creating a new zig extension for the zed editor.

This is because i'd like zigscient to be featured there as an alternative fork

For now i did create an own repo for building and providing releases, but it would probably be beneficial even for this repo, because users could just simply download it really quick.

That is my current workflow.
It's pretty dumbed down and just runs every day. If it's in the official repo we could just add the publishing of artifacts to the end of your test runs, which shouldn't significantly increase te build times too much.

name: Build Zigscient Nightly
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"
  push:
    branches:
      - main
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          repository: llogick/zigscient
          ref: dev
      - uses: mlugg/setup-zig@v1
        with:
          version: master
      - name: Build all targets
        run: |
          mkdir -p builds
          for target in "x86_64-linux-gnu" "aarch64-linux-gnu" "x86_64-windows" "aarch64-windows" "x86_64-macos" "aarch64-macos"; do
            zig build -Dtarget=${target} -Doptimize=ReleaseFast
            if [[ $target == *"windows"* ]]; then
              cp zig-out/bin/zigscient.exe builds/zigscient-${target}.exe
            else
              cp zig-out/bin/zigscient builds/zigscient-${target}
            fi
          done
      - uses: actions/upload-artifact@v4
        with:
          name: zigscient-release
          path: builds/
  release:
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: zigscient-release
          path: zigscient-release
      - name: Get current date
        run: echo "CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
      - name: Create zips
        run: |
          cd zigscient-release
          for file in *; do
            zip -j "../${file%.*}.zip" "$file"
          done
      - uses: softprops/action-gh-release@v2
        with:
          name: ${{ env.CURRENT_DATE }}
          tag_name: ${{ env.CURRENT_DATE }}
          draft: false
          make_latest: true
          files: "*.zip"
@nuIIpointerexception nuIIpointerexception added the enhancement New feature or request label Nov 24, 2024
@llogick
Copy link
Owner

llogick commented Nov 24, 2024

I've been reluctant to do it, but will prioritize it

Notes (to self)

  • only if branch == dev
  • on demand only/manually triggered or otherwise implement a version check to avoid spamming everyone's feed
  • 0ba667a (would probably require targeting musl)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants