v0.1.35 #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | |
name: Node.js Package | |
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 - ReSubstitute ${{ env.RELEASE_VERSION }} | |
summary: New release ReSubstitute ${{ env.RELEASE_VERSION }} from commit ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} | |
theme_color: 'e632ad' | |
sections: '[{ "activityTitle": "ReSubstitute", "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@v2 | |
with: | |
always-auth: true | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build --if-present | |
- name: Publish NPMJS @fdmg | |
if: contains(github.ref, 'canary') == false | |
run: npm publish --provenance ./dist | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_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.npm_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.npm_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.npm_token}} | |
continue-on-error: true | |
- name: Use Node.js (GitHub) ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
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 | |