Skip to content

Commit

Permalink
feat(rebrand): archimail => archifiltre-mails (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias committed Feb 1, 2022
1 parent 77d1c6b commit ecfd3f5
Show file tree
Hide file tree
Showing 21 changed files with 271 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/US.yml
@@ -1,5 +1,5 @@
name: User Story
description: Création d'une histoire utilisateur pour Archimail
description: Création d'une histoire utilisateur pour Mails
labels:
- enhancement
body:
Expand Down Expand Up @@ -67,4 +67,4 @@ body:
- BV:XL
- BV:L
- BV:M
- BV:S
- BV:S
4 changes: 0 additions & 4 deletions .github/actions/setup-node/action.yml
Expand Up @@ -14,7 +14,3 @@ runs:
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: yarn

- name: Installing
shell: bash
run: yarn --frozen-lockfile --perfer-offline
144 changes: 144 additions & 0 deletions .github/workflows/branch-test-setup.yml
@@ -0,0 +1,144 @@
name: Manual branch test setup
on:
# TODO: if pr comment or contains label "has-test-bin"
workflow_dispatch:
inputs:
bin_type:
type: choice
options: [win, mac, linux]
default: win
required: true
description: The produced binary type

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
compile:
name: Compile
runs-on: ubuntu-latest
if: "!contains('refs/heads/main,refs/heads/beta,refs/heads/dev', github.ref)"
outputs:
current-version: ${{ steps.compile.outputs.current-version }}
next-version: ${{ steps.compile.outputs.next-version }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: |
yarn config set network-timeout 300000
yarn --frozen-lockfile --perfer-offline
yarn electron-builder install-app-deps
env:
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
- name: Set .env to production
run: cp .env.prod .env
- id: compile
name: Compile
run: |
echo "${{ toJson(github) }}"
TMP_CURRENT_VERSION="$(node -e "console.log(require('./package.json').version)")"
echo ::set-output name=current-version::$TMP_CURRENT_VERSION
TMP_NEXT_VERSION="$TMP_CURRENT_VERSION-$(node -e "console.log('${{ github.ref }}'.replace('refs/heads/', ''))" | iconv -t ascii//TRANSLIT | sed -r "s/[^a-zA-Z0-9]+/-/g" | sed -r "s/^-+\|-+$//g" | tr A-Z a-z).0"
yarn global add replace
$(yarn global bin)/replace "\"version": \"$TMP_CURRENT_VERSION\"" "\"version": \"$TMP_NEXT_VERSION\"" package.json
echo ::set-output name=next-version::$TMP_NEXT_VERSION
yarn webpack --mode production
yarn webpack --mode production --config webpack.electron-main.js
- name: Archive dist
uses: actions/upload-artifact@v2
with:
name: compile-dist
path: dist/

build:
needs: compile
strategy:
matrix:
target:
- ${{ github.event.inputs.bin_type }}
os:
- ${{ github.event.inputs.bin_type == 'linux' && 'ubuntu' || github.event.inputs.bin_type == 'mac' && 'macos' || 'windows' }}-latest
bin-output:
- ${{ (github.event.inputs.bin_type == 'linux' && 'AppImage') || github.event.inputs.bin_type == 'mac' && 'dmg' || 'portable' }}

name: Build binary for ${{ matrix.target }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
# no signing env because we don't care for test bin

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: |
yarn config set network-timeout 300000
yarn --frozen-lockfile --perfer-offline
- name: Replace version in package.json
shell: bash
run: |
yarn global add replace
$(yarn global bin)/replace '"version": "${{ needs.compile.outputs.current-version }}"' '"version": "${{ needs.compile.outputs.next-version }}"' package.json
- name: Download dist
uses: actions/download-artifact@v2
with:
name: compile-dist
path: dist/
- name: Build bin
run: yarn electron-builder --x64 --${{ matrix.target}} ${{ matrix.bin-output }}
- name: Archive bin
uses: actions/upload-artifact@v2
with:
name: bin
path: electron/dist/*/archifiltre-*

release:
if: ${{ success() }}
needs:
- build
- compile
name: Release branch bin
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.SOCIALGROOVYBOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SOCIALGROOVYBOT_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_push_gpgsign: false
git_tag_gpgsign: true
- name: Create tag if needed
run: |
git fetch --tags -p
(
git tag -s "$TAG_VERSION" -m "Temp tag [skip ci]" &&
git push --tags
) || true
env:
TAG_VERSION: v${{ needs.compile.outputs.next-version }}
- name: Downloads bin
uses: actions/download-artifact@v2

- name: Release tip tag for branch
uses: pyTooling/Actions/releaser@r0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: bin/*/archifiltre-*.*
tag: v${{ needs.compile.outputs.next-version }}
rm: true
46 changes: 46 additions & 0 deletions .github/workflows/branch-test-teardown.yml
@@ -0,0 +1,46 @@
name: Manual branch test teardown
on:
pull_request_target:
types: [closed]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
teardown:
name: Seek & Destroy
runs-on: ubuntu-latest
# TODO: if pr contains label "has-test-bin"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}
- name: Seek
id: seek
run: |
TAG_VERSION="$(echo '${{ github.head_ref }}' | iconv -t ascii//TRANSLIT | sed -r "s/[^a-zA-Z0-9]+/-/g" | sed -r "s/^-+\|-+$//g" | tr A-Z a-z)"
TAG_VERSION="v$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' package.json)-$TAG_VERSION.0"
echo ::set-output name=tag-version::$TAG_VERSION
- name: Destroy local
id: destroy-local
run: |
git fetch --tags -p
set -e
TAG_NOT_FOUND=0
git tag -d '${{ steps.seek.outputs.tag-version }}' || TAG_NOT_FOUND=1
echo ::set-output name=tag-not-found::$TAG_NOT_FOUND
- name: Destroy remote
if: ${{ steps.destroy-local.outputs.tag-not-found == 0 }}
run: |
(
gh release delete "$TAG_VERSION" --yes --repo $REPO &&
git push --delete origin "$TAG_VERSION" &&
gh pr comment $PR_NUMBER --body "$TAG_VERSION successfully destroyed! ($RUN_URL)" --repo $REPO
) || gh pr comment $PR_NUMBER --body "$TAG_VERSION deletion failed ($RUN_URL)" --repo $REPO
env:
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.number }}
TAG_VERSION: ${{ steps.seek.outputs.tag-version }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/runs/${{ github.run_id }}
14 changes: 9 additions & 5 deletions .github/workflows/e2e.yml
Expand Up @@ -5,20 +5,22 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 1 * * 1-5' # every night before week day, at 1pm on dev
- cron: 0 1 * * 1-5 # every night before week day, at 1pm on dev

env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

jobs:
Compile:
compile:
name: Compile application
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: yarn --frozen-lockfile --perfer-offline

- name: Compiling
run: yarn compile
Expand All @@ -29,12 +31,11 @@ jobs:
name: compile-dist
path: dist/


E2E:
env:
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
name: Run E2E test on ${{ matrix.os }}
needs: Compile
needs: compile
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -44,6 +45,10 @@ jobs:
- uses: actions/checkout@v2
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: |
yarn config set network-timeout 300000
yarn --frozen-lockfile --perfer-offline
- name: Download dist
uses: actions/download-artifact@v2
with:
Expand All @@ -67,4 +72,3 @@ jobs:
- name: Clean Xvfb
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/kill-xvfb

13 changes: 5 additions & 8 deletions .github/workflows/quality.yml
Expand Up @@ -9,21 +9,18 @@ env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

jobs:
Quality:
strategy:
matrix:
# default mandatory matrix
empty: [true]
# Don't fast-fail on push main
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref != 'refs/heads/main') }}

quality:
name: Quality Control on Node (ubuntu-latest)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: |
yarn config set network-timeout 300000
yarn --frozen-lockfile --perfer-offline
- name: Lint
run: yarn lint && yarn lint:test
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/release.yml
Expand Up @@ -34,6 +34,8 @@ jobs:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: yarn --frozen-lockfile --perfer-offline
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
Expand All @@ -52,7 +54,7 @@ jobs:
echo ::set-output name=next-version::$(node -e "console.log(require('./package.json').version)")
yarn compile
env:
ARCHIMAIL_RELEASE_MODE: version
ARCHIFILTRE_RELEASE_MODE: version
- name: Archive dist
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -85,13 +87,19 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: |
yarn config set network-timeout 300000
yarn --frozen-lockfile --perfer-offline
- name: Replace version in package.json
shell: bash
run: |
Expand All @@ -104,16 +112,12 @@ jobs:
path: dist/
- name: Build bin
run: yarn dist:${{ matrix.target }}
# Test mode
# run: |
# mkdir -p "electron/dist/${{ matrix.target }}/"
# echo "${{ matrix.target }}.${{ matrix.os }}" > "electron/dist/${{ matrix.target }}/archimail.${{ matrix.ext }}"
- name: Archive bin
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}-bin
path: |
electron/dist/*/archimail*.*
electron/dist/*/archifiltre*.*
electron/dist/*/latest*.yml
release:
Expand All @@ -131,11 +135,13 @@ jobs:
- name: Generate hashes
run: >-
find . -regextype posix-extended
-regex ".*/bin/.*/archimail.*\.(exe|AppImage|dmg|msi|zip)$"
-regex ".*/bin/.*/archifiltre.*\.(exe|AppImage|dmg|msi|zip)$"
-type f
-exec bash -c "openssl dgst -sha512 {} > {}.sha512" \;
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Yarn install
run: yarn --frozen-lockfile --perfer-offline
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-license.yml
@@ -1,10 +1,10 @@
name: Update LICENSE date
on:
schedule:
- cron: "0 0 1 1 *" # every 1rst January on dev
- cron: 0 0 1 1 * # every 1rst January on dev

jobs:
update_date:
update-date:
name: Update LICENSE date
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ecfd3f5

Please sign in to comment.