feat: changes for splunk 0.1.0 release #1
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: Release | |
permissions: | |
contents: write | |
pull-requests: write | |
attestations: write | |
id-token: write | |
on: | |
push: | |
tags: | |
- '**[0-9]+.[0-9]+.[0-9]+**' | |
jobs: | |
plan: | |
runs-on: ubuntu-latest | |
# Map a step output to a job output | |
outputs: | |
name: ${{ steps.name.outputs.name }} | |
version: ${{ steps.version.outputs.version }} | |
env: | |
TAG: ${{ github.ref_name }} | |
steps: | |
- name: Get plugin name | |
id: name | |
run: echo "name=${TAG%%-*}" >> $GITHUB_OUTPUT | |
- name: Get plugin version | |
id: version | |
run: echo "version=${TAG##*-}" >> $GITHUB_OUTPUT | |
build: | |
runs-on: ubuntu-latest | |
needs: plan | |
steps: | |
- name: GitHub Tag Name example | |
run: | | |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" | |
echo "Tag name from github.ref_name: ${{ github.ref_name }}" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: jcbhmr/setup-cargo-component@v1 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo component build --release -p ${{ needs.plan.outputs.name }} | |
- name: Attest | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: "target/wasm32-wasi/release/*.wasm" | |
- name: Archive built artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ needs.plan.outputs.name }}.wasm | |
if-no-files-found: error | |
path: | | |
target/wasm32-wasi/release/${{ needs.plan.outputs.name }}.wasm | |
release: | |
name: Create release | |
needs: | |
- plan | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Fetch artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ needs.plan.outputs.name }}.wasm | |
path: release | |
- name: Generate checksum | |
working-directory: release | |
run: sha256sum ${{ needs.plan.outputs.name }}.wasm > ${{ needs.plan.outputs.name }}.wasm.sha256 | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: ${{ needs.plan.outputs.name }} ${{ needs.plan.outputs.version }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
release/${{ needs.plan.outputs.name }}.wasm | |
release/${{ needs.plan.outputs.name }}.wasm.sha256 | |
body: | | |
## Download lgc ${{ needs.plan.outputs.name }} - ${{ needs.plan.outputs.version }} | |
| File | Checksum | | |
|--------|----------| | |
|[${{ needs.plan.outputs.name }}.wasm](https://github.com/LogCraftIO/logcraft-cli-plugins/releases/download/${{ github.ref_name }}/${{ needs.plan.outputs.name }}.wasm) | [checksum](https://github.com/LogCraftIO/logcraft-cli-plugins/releases/download/${{ github.ref_name }}/${{ needs.plan.outputs.name }}.wasm) | | |
## Verifying GitHub Artifact Attestations | |
The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the [GitHub CLI](https://cli.github.com/manual/gh_attestation_verify): | |
```sh | |
gh attestation verify <file-path of downloaded artifact> --repo LogCraftIO/logcraft-cli-plugins | |
``` |