Skip to content

Commit

Permalink
chore: draft release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
crystall-bitquill committed Oct 23, 2024
1 parent 236e98b commit a937f52
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Release Draft'

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
branches:
- release-draft-workflow

permissions:
actions: write
contents: write
deployments: write
packages: write
pull-requests: write
repository-projects: write

jobs:
ubuntu-latest-nodejs-wrapper-release-gh-draft:
name: 'Build And Release Draft'
runs-on: ubuntu-latest
steps:
- name: 'Clone Repository'
uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Set up Node.js'
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: 'Install dependencies'
run: npm install --no-save
- name: 'Run eslint - linting'
run: npm run lint
- name: 'Check formatting'
run: npm run check
- name: 'Run unit tests'
run: npm test
- name: 'Package Wrapper'
run: npm pack --pack-destination ./build
- name: 'Set Version Env Variable'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: 'Get Release Details'
run: |
export RELEASE_DETAILS="$(awk -vN=2 'n<N;/^## /{++n}' CHANGELOG.md)"
export RELEASE_DETAILS="$(sed '${/^# /d;}' <<< "$RELEASE_DETAILS")"
export RELEASE_DETAILS="$(sed '$d' <<< "$RELEASE_DETAILS")"
touch RELEASE_DETAILS.md
echo "$RELEASE_DETAILS" > RELEASE_DETAILS.md
- name: 'Upload to Draft Release'
uses: ncipollo/release-action@v1
with:
draft: true
name: "AWS Advanced NodeJS Wrapper - v${{ env.RELEASE_VERSION }}"
bodyFile: RELEASE_DETAILS.md
artifacts: ./build/*
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200).

## [0.0.1]

[0.0.1]: https://github.com/awslabs/aws-advanced-nodejs-wrapper/releases/tag/0.0.1

0 comments on commit a937f52

Please sign in to comment.