Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ jobs:
check-changelog:
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.body, '[skip changelog]') &&
!contains(github.event.pull_request.body, '[changelog skip]') &&
!contains(github.event.pull_request.body, '[skip ci]') &&
!contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
!contains(github.event.pull_request.labels.*.name, 'dependencies')
contains(github.event.pull_request.head.ref, 'release-')
steps:
- uses: actions/checkout@v4
- name: Check that CHANGELOG is touched
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish to NPM and Change Management

on:
workflow_run:
workflows: ["Create Github Tag and Release"]
types:
- completed
branches:
- main

permissions:
contents: write
actions: read
id-token: write

jobs:
check_for_moratorium:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
environment: change_management
steps:
- uses: actions/checkout@v4
- env:
TPS_API_TOKEN: ${{ secrets.TPS_API_TOKEN_PARAM }}
run: ./scripts/release/tps-check-lock heroku-applink-nodejs ${{ github.sha }}

publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs: check_for_moratorium
runs-on: ubuntu-latest
environment: change_management
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Get the latest tag
id: get_tag
run: |
TAG=$(git describe --tags --abbrev=0)
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Using tag: $TAG"

- name: Checkout the tagged version
run: |
git checkout ${{ steps.get_tag.outputs.tag }}

- name: Install dependencies
run: npm ci

- name: Build the project
run: npm run build

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_AUTOMATION_TOKEN }}

- name: Publish To Change Management
env:
ACTOR_EMAIL: ${{ secrets.TPS_API_RELEASE_ACTOR_EMAIL }}
TPS_API_TOKEN: ${{ secrets.TPS_API_TOKEN_PARAM }}
# Failure to record the release should not fail the workflow for now.
continue-on-error: true
run: ./scripts/release/tps-record-release heroku-applink-nodejs ${{ github.sha }}
71 changes: 71 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Create Github Tag and Release

on:
workflow_run:
workflows: ["Test, Lint, and Build"]
types:
- completed
branches:
- main

permissions:
contents: write
actions: read
id-token: write

jobs:
push-git-tag:
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_commit.message, 'Merge pull request') && contains(github.event.workflow_run.head_commit.message, 'release-v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-java@v4 # java required for testing with wiremock
with:
java-package: jre
java-version: "11"
distribution: "zulu"
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm install
- run: npm run build

- name: Extract version from branch name
id: version
run: |
VERSION=$(echo "${{ github.event.workflow_run.head_commit.message }}" | grep -o 'release-v[0-9]\+\.[0-9]\+\.[0-9]\+' | sed 's/release-v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"

- name: Create and push Github tag
run: |
echo "Creating tag v${{ steps.version.outputs.version }}"
git tag -s "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
echo "Pushing tag to origin..."
git push origin "v${{ steps.version.outputs.version }}"
echo "Verifying tag was pushed:"
git ls-remote --tags origin "v${{ steps.version.outputs.version }}"

- name: Get tag name
id: get_tag
run: |
TAG=$(git describe --tags --abbrev=0)
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Using tag: $TAG"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
generate_release_notes: true
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build
name: Test, Lint, and Build

on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
branches: [main]
pull_request:
permissions:
contents: read
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ src/**/*.js
src/**/*.js.map
**/coverage/
**/.nyc_output

# Salesforce
.codegenie/

# Heroku TPS TEMP
tpsGetLock_response.txt
tpsRecordRelease_response.txt
67 changes: 46 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,56 @@
# Changelog

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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/spec/v2.0.0.html).
## [1.0.0-ea.2](https://github.com/heroku/heroku-applink-nodejs/compare/v1.0.0-ea.1...v1.0.0-ea.2) - 2025-06-20

### Changes

## [0.1.0-ea] - 2024-08-12
### Features
* Add X-Request-Id header
* Extract User-Agent header from package.json
* Add GitHub pull request template

### Fixes
* Fix Java heap memory test issue

### Docs
* Update HttpRequestUtil.request documentation
* Update license year

### Other
* Rename HTTPResponseError -> HttpResponseError

## [1.0.0-ea.1](https://github.com/heroku/heroku-applink-nodejs/compare/v1.0.0-ea.0...v1.0.0-ea.1) - 2025-06-06

### Changes

- Initial
### Other
* Remove dynamic UA

## [1.0.0-ea] - 2025-06-05
- Update CODEOWNERS
- Updated `getAuthorization` to use the correct API URL.
- Rename `getConnection(name: string)` -> `getAuthorization(developerName: string, attachmentNameOrColorUrl = "HEROKU_APPLINK")`, accepting a new attachmentNameOrColorOrUrl to use a specific Applink addon's config.
- Remove node-fetch in favor of native fetch, add `HTTPResponseError`
## [1.0.0-ea.0](https://github.com/heroku/heroku-applink-nodejs/compare/v1.0.0-ea...v1.0.0-ea.0) - 2025-06-06

## [1.0.0-ea.0] - 2025-06-06
- Add `X-App-UUID` header, `heroku-applink-node-sdk` UA.
### Changes

### Features
* Add X-App-UUID header, heroku-applink-node-sdk UA

## [1.0.0-ea](https://github.com/heroku/heroku-applink-nodejs/compare/v0.1.0-ea...v1.0.0-ea) - 2025-06-05

### Changes

### Features
* Updated getAuthorization to use the correct API URL
* Rename getConnection(name: string) -> getAuthorization(developerName: string, attachmentNameOrColorUrl = "HEROKU_APPLINK"), accepting a new attachmentNameOrColorOrUrl to use a specific Applink addon's config
* Remove node-fetch in favor of native fetch, add HTTPResponseError

### Other
* Update CODEOWNERS

## [0.1.0-ea] - 2024-08-12

## [1.0.0-ea.1] - 2025-06-06
- Remove dynamic UA.
### Changes

## [1.0.0-ea.2] - 2025-06-20
- Update `HttpRequestUtil.request` documentation
- Update license year
- Add `X-Request-Id` header
- Extract `User-Agent` header from package.json
- Rename `HTTPResponseError` -> `HttpResponseError`
- Add GitHub pull request template
- Fix Java heap memory test issue
### Features
* Initial release
2 changes: 1 addition & 1 deletion bin/publish.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ echo "Running npm publish..."
npm publish

echo "Creating git tag..."
git tag "v${version}"
git tag -s "v${version}"
git push --tags
Loading