From d13e11c47bfab656fe176de3bac2325801871790 Mon Sep 17 00:00:00 2001 From: dblock Date: Tue, 22 Oct 2024 09:25:30 -0400 Subject: [PATCH] Added a release workflow triggerred on a tag. Signed-off-by: dblock --- .github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..5cd914742 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Draft a Release + +on: + push: + tags: + - "*" + +jobs: + draft-a-release: + name: Draft a Release + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Build + run: npm ci && npm run merge + + - name: Upload Artifacts + id: upload + uses: actions/upload-artifact@v4 + with: + name: build + path: | + build/* + + - name: Release Specification to GitHub + id: release + uses: marvinpinto/action-automatic-releases@v1.2.1 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + automatic_release_tag: ${{ github.ref_name }} + prerelease: true + title: OpenSearch OpenAPI Spec (${{ github.ref_name }}) + files: | + LICENSE.txt + build/* + + - name: Extract Changelog + id: changelog + uses: sean0x42/markdown-extract@v2 + with: + file: CHANGELOG.md + pattern: Unreleased + + - name: Update Release Description + id: update + uses: tubone24/update_release@v1.3.1 + env: + TAG_NAME: ${{ github.ref_name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body: | + ${{ steps.changelog.outputs.markdown }} + + ### Links + - [Build Artifact](${{ steps.upload.outputs.artifact-url }})