Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up GitHub releases #51

Merged
merged 5 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
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: Winglib 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: Winglib 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: Winglib 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: Winglib 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: Winglib 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: Winglib 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: Winglib 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: Winglib 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\"",
Chriscbr marked this conversation as resolved.
Show resolved Hide resolved
"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 }}";
Chriscbr marked this conversation as resolved.
Show resolved Hide resolved

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: "Winglib {base} v\$\{\{ env.WINGLIB_VERSION \}\}",
Chriscbr marked this conversation as resolved.
Show resolved Hide resolved
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