Skip to content

Commit

Permalink
chore: set up GitHub releases (#51)
Browse files Browse the repository at this point in the history
Set up GitHub releases. This will be used to set up a webhook that detects newly released packages from GitHub release events.

Version bumped `postgres` for testing purposes
  • Loading branch information
Chriscbr authored Jan 4, 2024
1 parent 2861b56 commit f9ef224
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/bedrock-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: bedrock
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: bedrock
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: bedrock
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: bedrock-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: bedrock v${{ env.WINGLIB_VERSION }}
tag_name: bedrock-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/checks-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: checks
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: checks
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: checks-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: checks v${{ env.WINGLIB_VERSION }}
tag_name: checks-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/containers-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: containers
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: containers
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: containers
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: containers-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: containers v${{ env.WINGLIB_VERSION }}
tag_name: containers-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/fifoqueue-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: fifoqueue
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: fifoqueue
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: fifoqueue
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: fifoqueue-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: fifoqueue v${{ env.WINGLIB_VERSION }}
tag_name: fifoqueue-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: github
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: github
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: github
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: github-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: github v${{ env.WINGLIB_VERSION }}
tag_name: github-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/postgres-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: postgres
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: postgres
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: postgres
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: postgres-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: postgres v${{ env.WINGLIB_VERSION }}
tag_name: postgres-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/redis-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: redis
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: redis
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: redis
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: redis-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: redis v${{ env.WINGLIB_VERSION }}
tag_name: redis-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/websockets-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ jobs:
- name: Pack
run: wing pack
working-directory: websockets
- name: Get package version
run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >>
"$GITHUB_ENV"
working-directory: websockets
- name: Publish
run: npm publish --access=public --registry https://registry.npmjs.org --tag
latest *.tgz
working-directory: websockets
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
tag: websockets-v${{ env.WINGLIB_VERSION }}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: websockets v${{ env.WINGLIB_VERSION }}
tag_name: websockets-v${{ env.WINGLIB_VERSION }}
files: "*.tgz"
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
31 changes: 30 additions & 1 deletion library.w
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,42 @@ pub class Library {
addCommonSteps(pullSteps);
addCommonSteps(releaseSteps);

releaseSteps.push({
name: "Get package version",
run: "echo WINGLIB_VERSION=\$(node -p \"require('./package.json').version\") >> \"$GITHUB_ENV\"",
"working-directory": libdir,
});

releaseSteps.push({
name: "Publish",
run: "npm publish --access=public --registry https://registry.npmjs.org --tag latest *.tgz",
"working-directory": libdir,
env: {
NODE_AUTH_TOKEN: "\$\{\{ secrets.NPM_TOKEN }}"
}
}
});

let tagName = "{base}-v\$\{\{ env.WINGLIB_VERSION \}\}";
let githubTokenWithAuth = "\$\{\{ secrets.PROJEN_GITHUB_TOKEN }}";

releaseSteps.push({
name: "Tag commit",
uses: "tvdias/[email protected]",
with: {
"repo-token": githubTokenWithAuth,
tag: tagName,
}
});

releaseSteps.push({
name: "GitHub release",
uses: "softprops/action-gh-release@v1",
with: {
name: "{base} v\$\{\{ env.WINGLIB_VERSION \}\}",
tag_name: tagName,
files: "*.tgz",
token: githubTokenWithAuth,
},
});

fs.writeYaml("{workflowdir}/{base}-release.yaml", {
Expand Down
2 changes: 1 addition & 1 deletion postgres/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/postgres",
"version": "0.0.5",
"version": "0.0.6",
"description": "Postgres support for Wing",
"repository": {
"type": "git",
Expand Down

0 comments on commit f9ef224

Please sign in to comment.