-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (100 loc) · 4.25 KB
/
publish.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Publish
on:
release:
types:
- created
env:
CI: true
jobs:
build:
permissions:
id-token: write
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Release version
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Set Timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Amsterdam"
timezoneMacos: "Europe/Amsterdam"
timezoneWindows: "Europe/Amsterdam"
- name: Get current date
id: date
run: echo "CURRENT_DATETIME=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
- name: Microsoft Teams
uses: aliencube/[email protected]
with:
webhook_uri: ${{secrets.TEAMS_WEBHOOK}}
title: New release - FDMG CSS Grid ${{ env.RELEASE_VERSION }}
summary: New release FDMG CSS Grid ${{ env.RELEASE_VERSION }} from commit ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
theme_color: '237ef4'
sections: '[{ "activityTitle": "FDMG CSS Grid", "facts": [ {"name": "When", "value": "${{ env.CURRENT_DATETIME }}" }, { "name": "Triggered by:", "value": "${{ github.actor }}" }, { "name": "Repository:", "value": "${{ github.repository }}" }, { "name": "Version:", "value": "${{ env.RELEASE_VERSION }}" } ] }]'
actions: '[{ "@type": "OpenUri", "name": "View job", "targets": [{ "os": "default", "uri": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }] }, { "@type": "OpenUri", "name": "Changelog", "targets": [{ "os": "default", "uri": "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ env.RELEASE_VERSION }}" }] }, { "@type": "OpenUri", "name": "Commit", "targets": [{ "os": "default", "uri": "${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" }] }, { "@type": "OpenUri", "name": "GitHub", "targets": [{ "os": "default", "uri": "${{ github.server_url }}/${{ github.repository }}" }] }]'
- name: Use Node.js (NPMJS) ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
always-auth: true
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:ci --if-present
- name: Publish NPMJS @fdmg
if: contains(github.ref, 'canary') == false
run: npm publish --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
continue-on-error: true
- name: Publish NPMJS @fdmg (canary)
if: contains(github.ref, 'canary')
run: npm publish --tag next --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
continue-on-error: true
- name: Use specific package.json for GHP
run: cp ./dist/package.github.json ./dist/package.json
- name: Publish NPMJS @fdmediagroep
if: contains(github.ref, 'canary') == false
run: npm publish --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
continue-on-error: true
- name: Publish NPMJS @fdmediagroep (canary)
if: contains(github.ref, 'canary')
run: npm publish --tag next --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
continue-on-error: true
- name: Use Node.js (GitHub) ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
always-auth: true
registry-url: 'https://npm.pkg.github.com'
scope: '@FDMediagroep'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish GPR
if: contains(github.ref, 'canary') == false
run: npm publish --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Publish GPR (canary)
if: contains(github.ref, 'canary')
run: npm publish --tag next --provenance ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true