Skip to content

Commit

Permalink
ci: add github actions (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansantiagojr authored Feb 9, 2024
1 parent 2d3a44b commit f6a91fe
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Continuous Deployment

on:
push:
tags:
- "v*.*.*"

jobs:
publish-github:
name: Publish on GitHub
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
TARGET:
[
x86_64-linux,
x86_64-macos,
x86_64-windows,
aarch64-linux,
aarch64-macos,
aarch64-windows,
arm-linux,
riscv64-linux,
i386-linux,
]

steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set the release version
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV

- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.11.0

- name: Build
run: zig build -Drelease-safe -Dtarget=${{ matrix.TARGET }}

- name: Upload the binary
uses: svenstaro/upload-release-action@v2
with:
file: zig-out/bin/binary-${{ env.RELEASE_VERSION }}-${{ matrix.TARGET }}*
file_glob: true
overwrite: true
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration

on:
pull_request:
push:
branches:
- main

jobs:
build:
name: "Build with args: '${{ matrix.OPTIMIZE }}'"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
OPTIMIZE: [""]
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.11.0

- name: Build
run: zig build ${{ matrix.OPTIMIZE }}

- name: Check formatting
run: zig fmt --check .

1 change: 0 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub fn main() !void {

var client = http.Client{ .allocator = allocator };
defer client.deinit();

var base_url = "https://www.toptal.com/developers/gitignore/api/";
var url_buffer: [256]u8 = undefined;
const url_to_request = try std.fmt.bufPrint(&url_buffer, "{s}{s}", .{ base_url, language });
Expand Down

0 comments on commit f6a91fe

Please sign in to comment.