This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
Refactor ircClient into CustomIrcClient #64
Workflow file for this run
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
name: Publish Docker Image and Native Binaries | |
on: | |
push: | |
branches: "*" | |
paths: | |
- .github/workflows/build.yaml | |
- discord-irc.ts | |
- lib/** | |
- deno.* | |
- Dockerfile | |
tags: "*.*.*" | |
jobs: | |
publish-docker: | |
name: Publish Docker Image to GitHub Container Registry | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Extract metadata for container image | |
uses: docker/metadata-action@v4 | |
id: metadata | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- name: Build and publish container image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
publish-binaries: | |
name: Publish Native Binaries | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- pi | |
- windows-latest | |
- macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Deno | |
if: matrix.os != 'pi' | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Compile AMD64 binary for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: deno compile --allow-net --allow-env=CONFIG_FILE,DEBUG,VERBOSE,NODE_EXTRA_CA_CERTS --allow-read --allow-write --output discord-irc-linux-amd64 discord-irc.ts | |
- name: Compile AMD64 binary for Windows | |
if: matrix.os == 'windows-latest' | |
run: deno compile --allow-net --allow-env=CONFIG_FILE,DEBUG,VERBOSE,NODE_EXTRA_CA_CERTS --allow-read --allow-write --output discord-irc-windows-amd64.exe discord-irc.ts | |
- name: Compile AMD64 binary for macOS | |
if: matrix.os == 'macos-latest' | |
run: deno compile --allow-net --allow-env=CONFIG_FILE,DEBUG,VERBOSE,NODE_EXTRA_CA_CERTS --allow-read --allow-write --output discord-irc-macos-amd64 discord-irc.ts | |
- name: Compile ARM64 binary for macOS | |
if: runner.os == 'macOS' | |
run: deno compile --allow-net --allow-env=CONFIG_FILE,DEBUG,VERBOSE,NODE_EXTRA_CA_CERTS --allow-read --allow-write --output discord-irc-macos-arm64 --target aarch64-apple-darwin discord-irc.ts | |
- name: Compile ARM64 binary for Linux | |
if: runner.os == 'Linux' && matrix.os == 'pi' | |
run: deno compile --allow-net --allow-env=CONFIG_FILE,DEBUG,VERBOSE,NODE_EXTRA_CA_CERTS --allow-read --allow-write --output discord-irc-linux-arm64 discord-irc.ts | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ runner.os }}-${{ runner.os == 'macOS' && 'X64-ARM64' || runner.arch }} | |
path: ./discord-irc-* | |
build-freebsd: | |
name: Publish Native Binaries (freebsd-latest) | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checkout FreeBSD ports repository | |
run: | | |
git clone --depth=1 https://git.FreeBSD.org/ports.git | |
tar -cf ports.tar ports/ | |
rm -rf ports/ | |
- name: Compile AMD64 binary for FreeBSD | |
uses: cross-platform-actions/action@v0.15.0 | |
with: | |
operating_system: freebsd | |
version: "13.2" | |
run: | | |
sudo tar -xf ports.tar -C /usr | |
sudo pkg install -y www/deno | |
deno task prepare | |
find . ! -name 'discord-irc' -delete | |
mv discord-irc discord-irc-freebsd-x64 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: FreeBSD-${{ runner.arch }} | |
path: ./discord-irc-* |