-
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.
feat: add release workflow and commit linting (#2)
* build(deps): add commitlint_cli and jusky packages * build: add commit message hook to lint commit messages * ci: add pull request workflow * docs: add contributing guide * chore: update gitignore * ci: add release workflow that updates version in yaml * feat: add nunito fints * refactor: rename license to copying * fix: move kotlin version to global gradle file * docs: add readme and repo assets * chore: squash * chore: squash * ci: use a debug build for pr checks workflow * docs: update readme docs to incorporate keys * ci: add partial implementation of deployment on release
- Loading branch information
1 parent
c41ab58
commit b369557
Showing
36 changed files
with
1,141 additions
and
147 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,12 @@ | ||
name: "Install yq" | ||
|
||
description: "Downloads and installs yq" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "π¦ Install yq" | ||
run: | | ||
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq | ||
sudo chmod +x /usr/bin/yq | ||
shell: bash |
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,25 @@ | ||
name: "Use Flutter Dependencies" | ||
|
||
description: "Installs the Flutter SDK and a project dependencies with caching." | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "β Set up Java" | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "17" | ||
distribution: "zulu" | ||
- name: "π§ Setup" | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
cache: true | ||
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache | ||
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | ||
flutter-version: 3.22.3 | ||
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies | ||
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path | ||
- name: "π¦ Install" | ||
run: flutter pub get | ||
shell: bash |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
<!-- | ||
The title should summarise what the purpose of this change, | ||
β οΈ**NOTE:** The title must conform to the conventional commit message format outlined in CONTRIBUTING.md document, at the root of the project. This is to ensure the merge commit to the main branch is picked up by the CI and creates an entry in the CHANGELOG.md. | ||
--> | ||
|
||
# Description | ||
<!-- Describe your changes in detail --> | ||
|
||
# Type of change | ||
<!-- What type of change does this change introduce? Put an 'x' in all the boxes that apply. --> | ||
|
||
- [ ] π₯ Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] ποΈ Build configuration (CI configuration, scaffolding etc.) | ||
- [ ] π Bug fix (non-breaking change which fixes an issue) | ||
- [ ] π Documentation update(s) | ||
- [ ] π¦ Dependency update(s) | ||
- [ ] π©π½βπ» Improve developer experience | ||
- [ ] β‘ Improve performance | ||
- [ ] β¨ New feature (non-breaking change which adds functionality) | ||
- [ ] β» Refactor | ||
- [ ] βͺ Revert changes | ||
- [ ] π§ͺ New tests or updates to existing tests |
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,37 @@ | ||
name: "Deploy" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
secrets: | ||
ANDROID_KEY_ALIAS: | ||
required: true | ||
ANDROID_KEY_PASSWORD: | ||
required: true | ||
ANDROID_KEYSTORE: | ||
required: true | ||
ANDROID_KEYSTORE_PASSWORD: | ||
required: true | ||
|
||
jobs: | ||
deploy_to_play_store: | ||
name: "Deploy To The Play Store" | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- name: "π Checkout" | ||
uses: actions/checkout@v4 | ||
- name: "π§ Setup" | ||
uses: ./.github/actions/use-dependencies | ||
- name: "π Create Android signing keys" | ||
env: | ||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} | ||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
run: ./scripts/create_android_signing_keys.sh | ||
- name: "ποΈ Build AppBundle" | ||
run: flutter build appbundle --release |
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,18 @@ | ||
name: "Deploy - Beta" | ||
|
||
on: | ||
release: | ||
types: [prereleased] # triggered on beta branch releases | ||
|
||
jobs: | ||
deploy: | ||
name: "π Deploy" | ||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
environment: "beta" | ||
secrets: | ||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} | ||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||
|
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,17 @@ | ||
name: "Deploy - Production" | ||
|
||
on: | ||
release: | ||
types: [released] # triggered on main branch releases | ||
|
||
jobs: | ||
deploy: | ||
name: "π Deploy" | ||
uses: ./.github/workflows/deploy.yml | ||
with: | ||
environment: "production" | ||
secrets: | ||
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | ||
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} | ||
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} | ||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} |
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,65 @@ | ||
name: "Pull Request Checks" | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
## | ||
# install | ||
## | ||
|
||
install: | ||
name: "Install" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "π Checkout" | ||
uses: actions/checkout@v4 | ||
- name: "π§ Setup" | ||
uses: ./.github/actions/use-dependencies | ||
|
||
## | ||
# validation | ||
## | ||
|
||
validate_pr_title: | ||
name: "Validate PR Title" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "π Checkout" | ||
uses: actions/checkout@v4 | ||
- name: "π§ Setup" | ||
uses: ./.github/actions/use-dependencies | ||
- name: "β Validate" | ||
run: echo ${{ github.event.pull_request.title }} | dart run commitlint_cli | ||
|
||
## | ||
# build | ||
## | ||
|
||
build_android: | ||
name: "Build Android" | ||
needs: [validate_pr_title] | ||
runs-on: ubuntu-latest | ||
environment: development | ||
steps: | ||
- name: "π Checkout" | ||
uses: actions/checkout@v4 | ||
- name: "π§ Setup" | ||
uses: ./.github/actions/use-dependencies | ||
- name: "ποΈ Build APK" | ||
run: flutter build apk --debug | ||
- name: "ποΈ Build AppBundle" | ||
run: flutter build appbundle --debug | ||
|
||
# build_ios: | ||
# name: "Build iOS" | ||
# needs: [validate_pr_title] | ||
# runs-on: macos-latest | ||
# environment: development | ||
# steps: | ||
# - name: "π Checkout" | ||
# uses: actions/checkout@v4 | ||
# - name: "π§ Setup" | ||
# uses: ./.github/actions/use-dependencies | ||
# - name: "ποΈ Build ios" | ||
# run: flutter build ios --release --no-codesign |
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,43 @@ | ||
name: "Release" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
secrets: | ||
WRITE_REPOS_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- name: "π Checkout" | ||
uses: actions/checkout@v4 | ||
- name: "π¦ Install yq" | ||
uses: ./.github/actions/install-yq | ||
- name: "π§ Setup" | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
- name: "π¦ Install" | ||
run: | | ||
yarn add semantic-release @semantic-release/{changelog,commit-analyzer,exec,git,github,release-notes-generator} | ||
- name: "π Release" | ||
env: | ||
# appears on the release commits | ||
GIT_AUTHOR_NAME: agoralabs-bot | ||
GIT_AUTHOR_EMAIL: tech@agoralabs.sh | ||
GIT_COMMITTER_NAME: agoralabs-bot | ||
GIT_COMMITTER_EMAIL: tech@agoralabs.sh | ||
# used to push the release commit and create the tags | ||
GITHUB_TOKEN: ${{ secrets.WRITE_REPOS_TOKEN }} | ||
run: yarn semantic-release |
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,15 @@ | ||
name: "Release - Beta" | ||
|
||
on: | ||
push: | ||
branches: | ||
- beta | ||
|
||
jobs: | ||
deploy: | ||
name: "π Release" | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
environment: "beta" | ||
secrets: | ||
WRITE_REPOS_TOKEN: ${{ secrets.WRITE_REPOS_TOKEN }} |
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,15 @@ | ||
name: "Release - Production" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: "π Release" | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
environment: "production" | ||
secrets: | ||
WRITE_REPOS_TOKEN: ${{ secrets.WRITE_REPOS_TOKEN }} |
Oops, something went wrong.