Skip to content

Commit

Permalink
Merge pull request #234 from stellar/release/3.5.0
Browse files Browse the repository at this point in the history
Release `3.5.0` to `main`
  • Loading branch information
marcelosalloum authored Feb 6, 2025
2 parents 4a9191a + 5ae1031 commit 56516e9
Show file tree
Hide file tree
Showing 21 changed files with 371 additions and 63 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/automated_release_process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Automated Release Process

permissions:
contents: write
pull-requests: write
issues: write

on:
workflow_dispatch:
inputs:
version:
description: "Release version (x.y.z or x.y.z-rc.1)"
required: true
type: string

env:
REPO_ORG: stellar
REPO_NAME: stellar-disbursement-platform-frontend
REVIEWER: marcelosalloum,marwen-abid

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Validate version format
run: |
if ! [[ ${{ inputs.version }} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta)\.[0-9]+)?$ ]]; then
echo "Error: Version must be in format x.y.z or x.y.z-rc.n"
echo "Examples:"
echo " 1.2.3"
echo " 1.2.3-rc.1"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token

- name: Configure Git User
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Create release/${{ inputs.version }} branch
run: |
git checkout -b release/${{ inputs.version }} origin/${{ github.ref_name }}
sed -i 's/"version": ".*"/"version": "${{ inputs.version }}"/' package.json
git add package.json
git commit -m "chore: bump version to ${{ inputs.version }}"
git push origin release/${{ inputs.version }}
- name: Create main PR
id: create_main_pr
run: |
MAIN_PR_URL=$(sed "s/{{version}}/${{ inputs.version }}/g" .github/workflows/templates/release-pr-main.md | \
gh pr create --repo ${{ env.REPO_ORG }}/${{ env.REPO_NAME }} \
--base main \
--head release/${{ inputs.version }} \
--title "Release \`${{ inputs.version }}\` to \`main\`" \
--body-file - \
--assignee "${{ github.actor }}" \
--reviewer "${{ env.REVIEWER }}")
echo "main_pr_url=${MAIN_PR_URL}" >> $GITHUB_OUTPUT
- name: Create release/${{ inputs.version }}-dev branch
run: |
git checkout -b release/${{ inputs.version }}-dev release/${{ inputs.version }}
git push origin release/${{ inputs.version }}-dev
- name: Create develop PR
id: create_dev_pr
run: |
DEV_PR_URL=$(sed -e "s/{{version}}/${{ inputs.version }}/g" \
-e "s|{{ main_pr_url }}|${{ steps.create_main_pr.outputs.main_pr_url }}|g" \
.github/workflows/templates/release-pr-dev.md | \
gh pr create --repo ${{ env.REPO_ORG }}/${{ env.REPO_NAME }} \
--base develop \
--head release/${{ inputs.version }}-dev \
--title "Release \`${{ inputs.version }}\` to \`dev\`" \
--body-file - \
--assignee "${{ github.actor }}" \
--reviewer "${{ env.REVIEWER }}")
echo "dev_pr_url=${DEV_PR_URL}" >> $GITHUB_OUTPUT
- name: Create Draft Release
id: create_release
run: |
RELEASE_URL=$(gh release create ${{ inputs.version }} \
--title "${{ inputs.version }}" \
--draft \
--notes "Initial draft for release \`${{ inputs.version }}\`")
echo "release_url=${RELEASE_URL}" >> $GITHUB_OUTPUT
- name: Create Issue
id: create_issue
run: |
ISSUE_URL=$(sed -e "s/{{version}}/${{ inputs.version }}/g" \
-e "s|{{ main_pr_url }}|${{ steps.create_main_pr.outputs.main_pr_url }}|g" \
-e "s|{{ dev_pr_url }}|${{ steps.create_dev_pr.outputs.dev_pr_url }}|g" \
-e "s|{{ release_url }}|${{ steps.create_release.outputs.release_url }}|g" \
.github/workflows/templates/release-issue.md | \
gh issue create \
--title "Release \`${{ inputs.version }}\`" \
--body-file - \
--label "release" \
--assignee "${{ github.actor }}")
echo "issue_url=${ISSUE_URL}" >> $GITHUB_OUTPUT
- name: Print Summary
run: |
echo "Release Process Summary for ${{ inputs.version }}"
echo "----------------------------------------"
echo "Issue: ${{ steps.create_issue.outputs.issue_url }}"
echo "Main PR: ${{ steps.create_main_pr.outputs.main_pr_url }}"
echo "Dev PR: ${{ steps.create_dev_pr.outputs.dev_pr_url }}"
echo "Draft Release: ${{ steps.create_release.outputs.release_url }}"
23 changes: 23 additions & 0 deletions .github/workflows/templates/release-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Release `{{version}}`

## Release Checklist

### Git Preparation

- [x] Create release branch `release/{{version}}` from `develop`
- [x] Create pull requests:
- Main PR: {{ main_pr_url }}
- Dev PR: {{ dev_pr_url }}

### Code Preparation

- [ ] Run tests and linting
- [ ] Complete the checklist and merge the main PR: {{ main_pr_url }}
- [ ] Complete the checklist and merge the dev PR: {{ dev_pr_url }}
- [ ] 🚨 DO NOT RELEASE before holidays or weekends! Mondays and Tuesdays are preferred.

### Publishing the Release

- [ ] After the main PR is merged, publish the draft release: {{ release_url }} -> [Release Page](https://github.com/stellar/stellar-disbursement-platform-frontend/releases/tag/{{version}})
- [ ] Verify the Docker image is published to [Docker Hub](https://hub.docker.com/r/stellar/stellar-disbursement-platform-frontend/tags)
- [ ] Propagate the helmchart version update to the [stellar/helm-charts](https://github.com/stellar/helm-charts) repository
7 changes: 7 additions & 0 deletions .github/workflows/templates/release-pr-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Release `{{version}}` to `dev`

### Pending

- [ ] Merge the main PR {{ main_pr_url }}
- [ ] Rebase this branch onto `main`
- [ ] 🚨 Merge this PR using the **`Merge pull request`** button
7 changes: 7 additions & 0 deletions .github/workflows/templates/release-pr-main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Release `{{version}}` to `main`

### Pending

- [x] Bump version in package.json
- [ ] Update CHANGELOG.md
- [ ] 🚨 Merge this PR using the **`Merge pull request`** button
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

> Place unreleased changes here.
## [3.5.0](https://github.com/stellar/stellar-disbursement-platform-frontend/releases/tag/3.5.0) ([diff](https://github.com/stellar/stellar-disbursement-platform-frontend/compare/3.4.0...3.5.0))

> [!WARNING] This version is only compatible with the
> [stellar/stellar-disbursement-platform-backend] version `3.5.0`.
### Added

- Added option to enable short linking in the Settings page.
[#230](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/230)

### Changes

- Make wide tables responsive and wrap disbursement name.
[#232](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/232)
- Automate the Release Process 🤖.
[#231](https://github.com/stellar/stellar-disbursement-platform-frontend/pull/231)

## [3.4.0](https://github.com/stellar/stellar-disbursement-platform-frontend/releases/tag/3.4.0) ([diff](https://github.com/stellar/stellar-disbursement-platform-frontend/compare/3.3.0...3.4.0))

> [!WARNING] This version is only compatible with the
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stellar-disbursement-platform-frontend",
"version": "3.4.0",
"version": "3.5.0",
"license": "Apache-2.0",
"engines": {
"node": ">=20.x"
Expand Down Expand Up @@ -125,6 +125,6 @@
"typescript-eslint": "^8.17.0",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
"webpack-dev-server": "^5.2.0"
}
}
36 changes: 36 additions & 0 deletions src/apiQueries/useUpdateOrgShortLinkEnabled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useMutation } from "@tanstack/react-query";
import { API_URL } from "constants/envVariables";
import { fetchApi } from "helpers/fetchApi";
import { AppError } from "types";

export const useUpdateOrgShortLinkEnabled = () => {
const mutation = useMutation({
mutationFn: (isEnabled: boolean) => {
const formData = new FormData();

formData.append("data", `{"is_link_shortener_enabled": ${isEnabled}}`);

return fetchApi(
`${API_URL}/organization`,
{
method: "PATCH",
body: formData,
},
{ omitContentType: true },
);
},
});

return {
...mutation,
error: mutation.error as AppError,
data: mutation.data as { message: string },
mutateAsync: async (isEnabled: boolean) => {
try {
await mutation.mutateAsync(isEnabled);
} catch {
// do nothing
}
},
};
};
15 changes: 7 additions & 8 deletions src/components/DisbursementsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,23 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
return (
<div className="FiltersWithSearch">
<Card noPadding>
<Table>
<Table isScrollable={true}>
<Table.Header>
{/* TODO: put back once ready */}
{/* <Table.HeaderCell width="1rem">
<Checkbox id="disbursements-select-all" fieldSize="xs" />
</Table.HeaderCell> */}
<Table.HeaderCell
width="9rem"
sortDirection={sortBy === "name" ? sortDir : defaultSortDirection}
onSort={() => handleSort("name")}
>
Disbursement name
</Table.HeaderCell>
<Table.HeaderCell width="5.7rem">Total payments</Table.HeaderCell>
<Table.HeaderCell>Successful</Table.HeaderCell>
<Table.HeaderCell>Failed</Table.HeaderCell>
<Table.HeaderCell>Canceled</Table.HeaderCell>
<Table.HeaderCell>Remaining</Table.HeaderCell>
<Table.HeaderCell textAlign="right">Successful</Table.HeaderCell>
<Table.HeaderCell textAlign="right">Failed</Table.HeaderCell>
<Table.HeaderCell textAlign="right">Canceled</Table.HeaderCell>
<Table.HeaderCell textAlign="right">Remaining</Table.HeaderCell>
<Table.HeaderCell
sortDirection={
sortBy === "created_at" ? sortDir : defaultSortDirection
Expand All @@ -125,7 +124,7 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
>
Created at
</Table.HeaderCell>
<Table.HeaderCell>Status</Table.HeaderCell>
<Table.HeaderCell textAlign="right">Status</Table.HeaderCell>
<Table.HeaderCell textAlign="right" width="4.8rem">
Total amount
</Table.HeaderCell>
Expand All @@ -141,7 +140,7 @@ export const DisbursementsTable: React.FC<DisbursementsTableProps> = ({
{/* <Table.BodyCell width="1rem">
<Checkbox id={`disbursement-${d.id}`} fieldSize="xs" />
</Table.BodyCell> */}
<Table.BodyCell title={d.name} width="7.25rem">
<Table.BodyCell title={d.name} wrap={true}>
<Link
onClick={(event) => handleDisbursementClicked(event, d)}
>
Expand Down
3 changes: 2 additions & 1 deletion src/components/InnerPage/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
&__content {
padding: pxToRem(32px);
color: var(--color-gray-90);
width: calc(pxToRem(1134px) + pxToRem(32px) * 2);
width: 100%;
max-width: pxToRem(2000px);
margin-left: auto;
margin-right: auto;

Expand Down
2 changes: 1 addition & 1 deletion src/components/PaymentsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const PaymentsTable = ({
return (
<div className="FiltersWithSearch">
<Card noPadding>
<Table isLoading={isLoading}>
<Table isLoading={isLoading} isScrollable={true}>
<Table.Header>
{/* TODO: put back once ready */}
{/* <Table.HeaderCell>
Expand Down
6 changes: 3 additions & 3 deletions src/components/ReceiversTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ export const ReceiversTable: React.FC<ReceiversTableProps> = ({
return (
<div className="FiltersWithSearch">
<Card noPadding>
<Table isLoading={isLoading}>
<Table isLoading={isLoading} isScrollable={true}>
<Table.Header>
{/* TODO: put back once ready */}
{/* <Table.HeaderCell width="1rem">
<Checkbox id="receivers-select-all" fieldSize="xs" />
</Table.HeaderCell> */}
<Table.HeaderCell width="9.5rem">Contact info</Table.HeaderCell>
<Table.HeaderCell>Contact info</Table.HeaderCell>
<Table.HeaderCell width="12rem">
Wallet provider(s)
</Table.HeaderCell>
Expand Down Expand Up @@ -119,7 +119,7 @@ export const ReceiversTable: React.FC<ReceiversTableProps> = ({
</Table.BodyCell> */}
<Table.BodyCell
title={getReceiverContactInfoTitle(d.phoneNumber, d.email)}
width="9.5rem"
wrap={true}
>
<Link onClick={(event) => onReceiverClicked(event, d.id)}>
{renderReceiverContactInfoItems(d.phoneNumber, d.email)}
Expand Down
Loading

0 comments on commit 56516e9

Please sign in to comment.