From 2000f5c7890f60960953967c612c97efbfb64f36 Mon Sep 17 00:00:00 2001 From: oksanabaza Date: Wed, 9 Oct 2024 13:42:44 +0100 Subject: [PATCH] Add ODH release workflow --- .github/workflows/odh-release.yaml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/odh-release.yaml diff --git a/.github/workflows/odh-release.yaml b/.github/workflows/odh-release.yaml new file mode 100644 index 0000000000..1a5c2bc165 --- /dev/null +++ b/.github/workflows/odh-release.yaml @@ -0,0 +1,48 @@ +# This workflow will compile e2e tests and release them + +name: ODH Release +on: + workflow_dispatch: + inputs: + version: + description: 'Tag to be used for release, i.e.: v0.0.1-odh-1' + required: true + +jobs: + release-odh: + runs-on: ubuntu-latest + + # Permission required to create a release + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Set Go + uses: actions/setup-go@v5 + with: + go-version-file: './go.mod' + + - name: Verify that release doesn't exist yet + shell: bash {0} + run: | + gh release view ${{ github.event.inputs.version }} + status=$? + if [[ $status -eq 0 ]]; then + echo "Release ${{ github.event.inputs.version }} already exists." + exit 1 + fi + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + + - name: Compile tests + run: | + go test -c -o compiled-tests/e2e ./test/e2e/ + + - name: Creates a release in GitHub + run: | + gh release create ${{ github.event.inputs.version }} --target ${{ github.ref }} compiled-tests/* + env: + GITHUB_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }} + shell: bash \ No newline at end of file