Skip to content

Commit

Permalink
testing release with actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Kumar committed Nov 28, 2023
1 parent e40d148 commit 6ba6309
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 18 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/callable-gh-publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release Workflow

on:
workflow_call:
inputs:
newTag:
description: 'The new tag for the release'
required: true
type: string
previousTag:
description: 'The previous tag to compare for generating changelog'
required: true
type: string
gh_token:
description: The github token that gives the job permissions to publish release notes on github
required: true
type: string

jobs:
create-changelog-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-js

- name: Generate changelog
uses: mikepenz/release-changelog-builder-action@v2
id: changelog
with:
fromTag: ${{ inputs.previousTag }}
toTag: ${{ inputs.newTag }}

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.newTag }}
name: Release ${{ inputs.newTag }}
body: ${{ steps.changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ inputs.gh_token }}
53 changes: 35 additions & 18 deletions .github/workflows/callable-npm-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,41 @@ jobs:
with:
path: amplify-js

- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build

###
# TODO Remove this to enable real NPM interactions.
# <remove>
- name: Load Verdaccio with AmplifyJs
uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
### </remove>

- name: Run npm publish
uses: ./amplify-js/.github/actions/npm-publish
with:
target: release
npm_token: ${{ secrets.NPM_TOKEN }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}
- name: testing aws-amplify version
working-directory: ./amplify-js
run: |
npm install -g lerna
lerna list --json | jq -r '.[] | select(.name=="aws-amplify") | .version'
echo "aws-amplify-prev-version=$(lerna list --json | jq -r '.[] | select(.name == "aws-amplify") | .version')" >> $GITHUB_ENV
echo "The version of 'aws-amplify' is $aws-amplify-prev-version"
# - name: Setup node and build the repository
# uses: ./amplify-js/.github/actions/node-and-build

# ###
# # TODO Remove this to enable real NPM interactions.
# # <remove>
# - name: Load Verdaccio with AmplifyJs
# uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
# ### </remove>

# - name: Run npm publish
# uses: ./amplify-js/.github/actions/npm-publish
# with:
# target: release
# npm_token: ${{ secrets.NPM_TOKEN }}
# gh_token: ${{ secrets.GITHUB_TOKEN }}
# github_user: ${{ vars.GH_USER}}
# github_email: ${{ vars.GH_EMAIL}}

# - name: Run gh release
# uses: ./.github/workflows/callable-gh-publish-release.yml
# with:
# newTag: ubuntu-latest
# previousTag: ubuntu-latest
# gh_token: ${{ secrets.GITHUB_TOKEN }}

# ################################################################################################################

# - name: Set github commit user
# env:
Expand Down

0 comments on commit 6ba6309

Please sign in to comment.