Skip to content

Release

Release #7

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "coraza-http-wasm version"
required: true
type: string
env:
GO_VERSION: "1.21.x"
jobs:
release:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Download coraza-http-wasm artifact
run: go run mage.go downloadArtifact
env:
VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run e2e tests
run: go run mage.go e2eLocal
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update version to ${{ github.event.inputs.version }}
run: go run mage.go updateVersion
env:
VERSION: ${{ github.event.inputs.version }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "*.yaml"
add_options: "-u"
branch: main
commit_message: "chore: update coraza-http-wasm version to ${{ github.event.inputs.version }}"
tagging_message: "${{ github.event.inputs.version }}"
- name: Remove coraza-http-wasm artifact
run: go run mage.go cleanupArtifact
- name: Create draft release
run: |
set +e
echo "Creating release $VERSION"
gh release create $VERSION --draft --title "$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
- name: Push build artifact to release
run: |
zip -j build/coraza-http-wasm-$VERSION.zip build/coraza-http-wasm.wasm LICENSE
gh release upload $VERSION ./build/coraza-http-wasm-$VERSION.zip --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}