Skip to content

Commit

Permalink
fix(ci): update ci and (no)secrets usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias committed Oct 24, 2022
1 parent 9eedac1 commit 91fd6fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Setup Node
description: Setup Node from .nvmrc and yarn install
description: Setup Node from .nvmrc

runs:
using: composite
steps:
- name: Read Node version from .nvmrc
shell: bash
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
run: echo "name=NVMRC::$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm

- name: Set up Node.js
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ jobs:
${{ env.CSC_LINK }}
- name: Setup Node
uses: ./.github/actions/setup-node
# >> NO Secrets
- name: Temp NO_SECRETS as .env file
run: |
touch ${{ github.run_id }}_${{ github.sha }}.env
echo "${{ secrets.NO_SECRETS }}" >> ${{ github.run_id }}_${{ github.sha }}.env
- name: Convert dotenv as output
id: nosecrets
uses: falti/dotenv-action@v1
with:
path: ${{ github.run_id }}_${{ github.sha }}.env
log-variables: true
mask-variables: false
- name: Remove temp .env file
run: rm -rf ${{ github.run_id }}_${{ github.sha }}.env
# << NO Secrets
- name: Yarn install
env:
npm_config_build_from_source: true
Expand All @@ -75,20 +90,20 @@ jobs:
# override because of "env-ci" used by semantic-release
# GITHUB_REF should not be default branch when "workflow_run" event is triggered
export GITHUB_REF=$GITHUB_REF_OVERRIDE
echo ::set-output name=current-version::$(node -e "console.log(require('./package.json').version)")
echo "current-version=$(node -e "console.log(require('./package.json').version)")" >> $GITHUB_OUTPUT
yarn semantic-release
echo ::set-output name=next-version::$(node -e "console.log(require('./package.json').version)")
echo "next-version=$(node -e "console.log(require('./package.json').version)")" >> $GITHUB_OUTPUT
yarn compile --no-progress
env:
ARCHIFILTRE_RELEASE_MODE: version
TRACKER_MATOMO_ID_SITE: ${{ secrets.TRACKER_MATOMO_ID_SITE }}
TRACKER_MATOMO_ID_SITE: ${{ steps.nosecrets.outputs.tracker_matomo_id_site }}
TRACKER_PROVIDER: ${{ steps.nosecrets.outputs.tracker_provider }}
SENTRY_ORG: ${{ steps.nosecrets.outputs.sentry_org }}
TRACKER_MATOMO_URL: ${{ secrets.TRACKER_MATOMO_URL }}
TRACKER_PROVIDER: ${{ secrets.TRACKER_PROVIDER }}
TRACKER_POSTHOG_API_KEY: ${{ secrets.TRACKER_POSTHOG_API_KEY }}
TRACKER_POSTHOG_URL: ${{ secrets.TRACKER_POSTHOG_URL }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
- name: Archive dist
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 91fd6fc

Please sign in to comment.