fluidd

Форк
0
/
release.yml 
132 строки · 3.2 Кб
1
name: RELEASE
2

3
on:
4
  push:
5
    tags:
6
      - 'v*'
7

8
jobs:
9
  build:
10
    name: Build
11
    runs-on: ubuntu-latest
12
    steps:
13
      - name: Checkout
14
        uses: actions/checkout@v4
15

16
      - name: Setup Node
17
        uses: actions/setup-node@v4
18
        with:
19
          node-version: 20
20
          cache: 'npm'
21

22
      - name: Install dependencies
23
        run: |
24
          npm ci
25

26
      - name: Run lint
27
        run: |
28
          npm run lint -- --no-fix
29

30
      - name: Run tests
31
        run: |
32
          npm run test:unit
33

34
      - name: Run circular references check
35
        run: |
36
          npm run circular-check
37

38
      - name: Build
39
        run: |
40
          npm run build
41

42
      - name: Create Artifact
43
        run: |
44
          cd ./dist
45
          zip -r ../fluidd.zip ./
46

47
      - name: Get version from tag
48
        id: tag_name
49
        run: |
50
          echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
51

52
      - name: Read ChangeLog
53
        uses: mindsers/changelog-reader-action@v2.2.0
54
        id: changelog
55
        with:
56
          validation_depth: 1
57
          version: ${{ steps.tag_name.outputs.current_version }}
58
          path: ./CHANGELOG.md
59

60
      - name: Create Release
61
        id: create_release
62
        uses: actions/create-release@v1
63
        env:
64
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65
        with:
66
          tag_name: ${{ github.ref }}
67
          release_name: ${{ github.ref }}
68
          body: |
69
            ${{ steps.changelog.outputs.changes }}
70
          draft: true
71
          prerelease: false
72

73
      - name: Upload Asset
74
        id: upload-release-asset
75
        uses: actions/upload-release-asset@v1
76
        env:
77
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78
        with:
79
          upload_url: ${{ steps.create_release.outputs.upload_url }}
80
          asset_path: ./fluidd.zip
81
          asset_name: fluidd.zip
82
          asset_content_type: application/zip
83

84
      - name: Upload Artifact
85
        uses: actions/upload-artifact@v4
86
        with:
87
          name: fluidd-${{ github.sha }}.zip
88
          path: ./dist
89

90
      - name: Publish Release
91
        uses: eregon/publish-release@v1
92
        env:
93
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94
        with:
95
          release_id: ${{ steps.create_release.outputs.id }}
96

97
  publish-web:
98
    name: Deploy to Host
99
    needs: build
100
    runs-on: ubuntu-latest
101
    permissions:
102
      id-token: write
103
      contents: read
104
    steps:
105
      - name: Checkout
106
        uses: actions/checkout@v4
107

108
      - name: Download fluidd.zip
109
        uses: actions/download-artifact@v4
110
        with:
111
          name: fluidd-${{ github.sha }}.zip
112
          path: ./dist
113

114
      - name: Prepare Deploy
115
        run: |
116
          cp ./server/config.json ./dist/config.json
117

118
      - uses: aws-actions/configure-aws-credentials@v4
119
        with:
120
          aws-region: us-east-1
121
          role-to-assume: ${{ secrets.AWS_GITHUB_ACTIONS_ROLE }}
122

123
      - name: Deploy to Host
124
        uses: reggionick/s3-deploy@v4
125
        with:
126
          folder: dist
127
          bucket: ${{ secrets.S3_BUCKET_NAME }}
128
          bucket-region: us-east-1
129
          dist-id: ${{ secrets.CF_DISTRIBUTION_ID }}
130
          delete-removed: true
131
          no-cache: true
132
          private: true
133

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.