-
Notifications
You must be signed in to change notification settings - Fork 13
41 lines (36 loc) · 1.67 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Release
run-name: Release ${{ inputs.version }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
node -e "const pkg = require('./package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, ' '), 'utf8')"
node -e "const pkg = require('./front/package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./front/package.json', JSON.stringify(pkg, null, ' '), 'utf8')"
node -e "const pkg = require('./graphql/package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./graphql/package.json', JSON.stringify(pkg, null, ' '), 'utf8')"
npm i --package-lock-only
npm i --prefix=graphql --package-lock-only
npm i --prefix=front --package-lock-only
RELEASE_GIT_NAME=$(curl -s https://api.github.com/users/$GITHUB_ACTOR | jq -r .name)
git config --local user.name "$RELEASE_GIT_NAME"
git config --local user.email "$RELEASE_GIT_EMAIL"
git commit -a -m "Release $RELEASE_VERSION"
git tag "v$RELEASE_VERSION"
git push origin master
git push origin "v$RELEASE_VERSION"
env:
RELEASE_VERSION: ${{ inputs.version }}
call-build-deploy-docker:
uses: EcrituresNumeriques/stylo/.github/workflows/docker.yml@master
with:
release-version: ${{ inputs.version }}
secrets: inherit
needs: [release]