-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: start of v1 - simplify and improve reliability
- Loading branch information
1 parent
ef98a10
commit 6fd086b
Showing
124 changed files
with
8,094 additions
and
1,385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Release client package to NPM | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "client/**" | ||
workflow_dispatch: | ||
inputs: | ||
release-type: | ||
description: "Release type (one of): patch, minor, major, prepatch, preminor, premajor, prerelease" | ||
required: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Import GPG key | ||
id: import-gpg | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
registry-url: https://registry.npmjs.org/ | ||
node-version: "18" | ||
|
||
- name: Git configuration | ||
run: | | ||
git config --global user.email "${{ steps.import-gpg.outputs.email }}" | ||
git config --global user.name "${{ steps.import-gpg.outputs.name }}" | ||
- name: Bump release version | ||
if: startsWith(github.event.inputs.release-type, 'pre') != true | ||
run: | | ||
NEW_VERSION=$(npm --no-git-tag-version version ${{ github.event.inputs.release-type }}) | ||
echo "NEW_VERSION=client-$NEW_VERSION" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=latest" >> $GITHUB_ENV | ||
env: | ||
RELEASE_TYPE: ${{ github.event.inputs.release-type }} | ||
working-directory: client | ||
|
||
- name: Bump pre-release version | ||
if: startsWith(github.event.inputs.release-type, 'pre') | ||
run: | | ||
NEW_VERSION=$(npm --no-git-tag-version --preid=beta version ${{ github.event.inputs.release-type }}) | ||
echo "NEW_VERSION=client-$NEW_VERSION" >> $GITHUB_ENV | ||
echo "RELEASE_TAG=beta" >> $GITHUB_ENV | ||
env: | ||
RELEASE_TYPE: ${{ github.event.inputs.release-type }} | ||
working-directory: client | ||
|
||
- name: Update changelog | ||
uses: superfaceai/release-changelog-action@v1 | ||
with: | ||
path-to-changelog: client/CHANGELOG.md | ||
version: ${{ env.NEW_VERSION }} | ||
operation: release | ||
|
||
- name: Get version changelog | ||
uses: superfaceai/release-changelog-action@v1 | ||
with: | ||
path-to-changelog: client/CHANGELOG.md | ||
version: ${{ env.NEW_VERSION }} | ||
operation: read | ||
|
||
- name: Update GitHub release documentation | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.NEW_VERSION }} | ||
body: ${{ steps.get-changelog.outputs.changelog }} | ||
prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }} | ||
|
||
- name: Commit CHANGELOG.md and package.json changes and create tag | ||
run: | | ||
git add client/package.json client/CHANGELOG.md | ||
git commit -m "release ${{ env.NEW_VERSION }}" | ||
working-directory: client | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
working-directory: client | ||
|
||
- name: Push to protected branch | ||
uses: CasperWA/push-protected@v2 | ||
with: | ||
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }} | ||
branch: main | ||
unprotect_reviews: true | ||
tags: true | ||
|
||
- name: Publish | ||
run: yarn publish --verbose --access public --tag ${{ env.RELEASE_TAG }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
working-directory: client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Deploy to Fly | |
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- "server/**" | ||
|
||
jobs: | ||
deploy: | ||
|
@@ -29,15 +31,24 @@ jobs: | |
run: flyctl deploy --remote-only | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
working-directory: server | ||
|
||
- name: 🎁 Bump version and push tag | ||
id: release | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
RELEASE_BRANCHES: main | ||
DEFAULT_BUMP: patch | ||
- name: Fetch all tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
|
||
- name: Determine new version tag | ||
id: versioning | ||
run: | | ||
LATEST_TAG=$(git tag -l "server-v*" --sort=-v:refname | head -n 1) | ||
echo "Latest server tag: $LATEST_TAG" | ||
if [[ "$LATEST_TAG" == "" ]]; then LATEST_TAG="server-v0.0.0"; fi | ||
PARTS=(${LATEST_TAG//./ }) | ||
VNUM=${PARTS[2]} | ||
((VNUM++)) | ||
NEW_TAG="server-v${PARTS[0]}.${PARTS[1]}.$VNUM" | ||
echo "New tag: $NEW_TAG" | ||
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV | ||
echo "::set-output name=new_tag::$NEW_TAG" | ||
- name: 🎙 Discord notification 2/3 | ||
env: | ||
|
@@ -50,3 +61,8 @@ jobs: | |
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
uses: Ilshidur/action-discord@master | ||
|
||
- name: Create and push new t]ag | ||
run: | | ||
git tag ${{ env.NEW_TAG }} | ||
git push origin ${{ env.NEW_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
# The directory Mix will write compiled artifacts to. | ||
/_build/ | ||
/server/_build/ | ||
|
||
# If you run "mix test --cover", coverage assets end up here. | ||
/cover/ | ||
/server/cover/ | ||
|
||
# The directory Mix downloads your dependencies sources to. | ||
/deps/ | ||
/server/deps/ | ||
|
||
# Where 3rd-party dependencies like ExDoc output generated docs. | ||
/doc/ | ||
/server/doc/ | ||
|
||
/server/.elixir_ls/ | ||
|
||
# Ignore .fetch files in case you like to edit your project deps locally. | ||
/.fetch | ||
/server/.fetch | ||
|
||
# If the VM crashes, it generates a dump, let's ignore it too. | ||
erl_crash.dump | ||
/server/erl_crash.dump | ||
|
||
# Also ignore archive artifacts (built via "mix archive.build"). | ||
*.ez | ||
/server/*.ez | ||
|
||
# Ignore package tarball (built via "mix hex.build"). | ||
mave_metrics-*.tar | ||
/server/mave_metrics-*.tar | ||
|
||
# Ignore assets that are produced by build tools. | ||
/priv/static/assets/ | ||
/server/priv/static/assets/ | ||
|
||
# Ignore digested assets cache. | ||
/priv/static/cache_manifest.json | ||
/server/priv/static/cache_manifest.json | ||
|
||
# In case you use Node.js/npm, you want to ignore these. | ||
npm-debug.log | ||
|
||
_pgdata | ||
node_modules | ||
.DS_Store | ||
|
||
/client/dist/ | ||
|
||
.env | ||
.envrc | ||
|
Oops, something went wrong.