Skip to content

Instantly share code, notes, and snippets.

View nilsreichardt's full-sized avatar
🔥
Focusing

Nils Reichardt nilsreichardt

🔥
Focusing
View GitHub Profile
@nilsreichardt
nilsreichardt / client-github-labels.json
Last active February 27, 2021 15:27
A template for importing a list of common client labels.
[
{
"name": "accessibility",
"description": "Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)",
"color": "38d8c8"
},
{
"name": "crash",
"description": "App crashes and is unusable in a significant way.",
"color": "900000"
@nilsreichardt
nilsreichardt / generate_protobuf_methods.js
Created May 27, 2021 16:47
This script will generate the Cloud Firestore rules bases on multiple protobuf files.
const execSync = require('child_process').execSync;
const fs = require("fs");
const path = require("path");
const rulesPath = path.join(__dirname, "..", "rules", "firestore.rules");
function getRules() {
return fs.readFileSync(rulesPath).toString();
}
@nilsreichardt
nilsreichardt / main.dart
Created August 15, 2021 10:45
Passing data via Flutter Navigator
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: HomePage(),
@nilsreichardt
nilsreichardt / codemagic.yaml
Last active February 11, 2022 14:55
App preview for every pull request commit
# Note: iOS app previews are only available with Codemagic teams.
# IPA needs to be signed. Docs for signing: https://docs.codemagic.io/yaml-code-signing/signing-ios/
#
# You need to add your GitHub PAT as environment variable to Codemaigc.
# Docs to create PAT: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
workflows:
app-preview:
name: App Preview
instance_type: mac_pro
@nilsreichardt
nilsreichardt / codemagic.yaml
Last active January 30, 2022 20:31
app-preview-articel
workflows:
app-preview:
name: App Preview
# All available instance types:
# https://docs.codemagic.io/yaml/yaml-getting-started/#instance-type
instance_type: mac_pro
max_build_duration: 75
environment:
groups:
- github
@nilsreichardt
nilsreichardt / codemagic.yaml
Last active January 30, 2022 20:36
Setup a simple workflow for building app previews articel
workflows:
app-preview:
name: App Preview
# All available instance types:
# https://docs.codemagic.io/yaml/yaml-getting-started/#instance-type
instance_type: mac_pro
max_build_duration: 75
environment:
flutter: v2.8.1
when:
scripts:
...
- name: Build APK
script: flutter build apk --profile
# Save the path to the builds, so the GitHub CLI can access the build files.
artifacts:
- build/**/outputs/apk/**/*.apk
environment:
groups:
- ios-publishing
- certificate_credentials
vars:
BUNDLE_ID: fun.gatch.v2mvp
...
scripts:
...
- name: iOS Code signing
publishing:
scripts:
- name: Authenticate GitHub CLI
script: |
echo $GITHUB_PAT > gh_credentials.txt
gh auth login --with-token < gh_credentials.txt
rm gh_credentials.txt
- name: Post builds to GitHub PR
script: |
export APK_LINK=$(echo $FCI_ARTIFACT_LINKS | jq '.[1] | .url')
@nilsreichardt
nilsreichardt / codemagic.yaml
Created January 30, 2022 21:14
App previews with Codemagic, but only andorid
workflows:
app-preview:
name: App Preview
# All available instance types:
# https://docs.codemagic.io/yaml/yaml-getting-started/#instance-type
instance_type: mac_pro
max_build_duration: 75
environment:
groups:
- github