Skip to content

Commit

Permalink
Generate an edge release when stable releases are created. (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
reynoldsalec authored Oct 25, 2024
1 parent df19eb4 commit f40849d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ jobs:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
PRERELEASE_TAG: edge
strategy:
matrix:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
Expand All @@ -28,7 +27,7 @@ jobs:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: npm
- name: Install NPM dependencies
- name: Install dependencies
run: npm clean-install --prefer-offline --frozen-lockfile

# Let's do tests rq just to make sure we dont push something that is fundamentally broken
Expand All @@ -49,14 +48,23 @@ jobs:
# Deploy
- name: Publish to npm
run: |
VERSION=$(node -p "require('./package.json').version")
PACKAGE=$(node -p "require('./package.json').name")
if [ "${{ github.event.release.prerelease }}" == "false" ]; then
npm publish --access public --dry-run
npm publish --access public
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}::This is a stable release published to the default 'latest' npm tag"
npm dist-tag add "$PACKAGE@$VERSION" edge
echo "::notice title=Published $VERSION to $PACKAGE::This is a stable release published to the default 'latest' npm tag"
echo "::notice title=Updated latest tag to $VERSION::The stable tag now points to $VERSION"
echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION"
else
npm publish --access public --tag ${{ env.PRERELEASE_TAG }} --dry-run
npm publish --access public --tag ${{ env.PRERELEASE_TAG }}
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}@${{ env.PRERELEASE_TAG }}::This is a pre-release published to the '${{ env.PRERELEASE_TAG }}' npm tag"
npm publish --access public --tag edge --dry-run
npm publish --access public --tag edge
echo "::notice title=Published $VERSION to $PACKAGE::This is a prerelease published to the 'edge' npm tag"
echo "::notice title=Updated edge tag to $VERSION::The edge tag now points to $VERSION"
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated release process to generate an edge release when stable releases are created.

* Removed unnecessary dependency lando/nginx.
* Updated lando/php to v1.5.0.
* Updated lando/mysql to v1.3.0.
Expand Down

0 comments on commit f40849d

Please sign in to comment.