Skip to content

Publish to Github Packages #3

Publish to Github Packages

Publish to Github Packages #3

Workflow file for this run

name: "Publish to Github Packages"
on:
workflow_dispatch:
inputs:
plugin:
description: "The plugin to publish"
type: "string"
required: true
tag:
description: "The existing tag to publish"
type: "string"
required: true
jobs:
publish-flake:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: rust
args: |
target_add wasm32-unknown-unknown
build --release --target wasm32-unknown-unknown
working-directory: ${{ inputs.plugin }}
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to the Container registry
run: |
pkgx wget https://github.com/fluentci-io/wasm-to-oci/releases/download/v0.1.2/wasm-to-oci_linux-amd64.tar.gz
tar xvf wasm-to-oci_linux-amd64.tar.gz
export PLUGIN=$(echo ${{ inputs.plugin }} | sed 's/-/_/g')
export TAG=$(echo ${{ inputs.tag }} | sed 's/${{ inputs.plugin }}\/v//g')
./wasm-to-oci push target/wasm32-unknown-unknown/release/$PLUGIN.wasm ghcr.io/fluentci-io/$PLUGIN:$TAG-wasm