Skip to content

Commit

Permalink
Generate an edge release when stable releases are created. (#47)
Browse files Browse the repository at this point in the history
* Generate an edge release when stable releases are created.

* Update dotnet test to look for correct curl exit code.
  • Loading branch information
reynoldsalec authored Oct 25, 2024
1 parent b4dded1 commit e5e16d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on:
release:
types:
- published
- edited

jobs:
deploy:
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 Down Expand Up @@ -46,19 +46,25 @@ jobs:
sync-username: rtfm-47

# Deploy
- name: Publish latest release to GitHub Packages
if: ${{ !github.event.release.prerelease }}
- 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"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
- name: Publish edge release to GitHub Packages
if: ${{ github.event.release.prerelease }}
run: |
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 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 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 }}
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}
2 changes: 1 addition & 1 deletion examples/2.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lando ssh -s defaults -c "dotnet --version" | grep "2."
lando ssh -s defaults -c "curl http://localhost" | grep "Hello there"

# Should not serve port 80 for cli
lando ssh -s cli -c "curl http://localhost" || echo $? | grep 1
lando ssh -s cli -c "curl http://localhost" || echo $? | grep 7
```

Destroy tests
Expand Down

0 comments on commit e5e16d0

Please sign in to comment.