diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f43a14f..265b4b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,14 +2,29 @@ name: Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v*' jobs: release: name: Release runs-on: ubuntu-latest steps: + - id: get-package + run: | + echo "::set-output name=version::${GITHUB_REF#refs/tags/}" + echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/} | grep -oP '(?<=\d\.\d\.\d-)\w+' || echo 'latest')" + shell: bash + # Reuse steps from Pull Request workflow - uses: actions/checkout@v3 + + - name: Check version + run: | + PACKAGE_VERSION=$(node -p "require('./package.json').version") + if [[ "${{steps.get-package.outputs.version}}" != "v${PACKAGE_VERSION}" ]]; then + echo "Tag version ${{steps.get-package.outputs.version}} does not match package version ${PACKAGE_VERSION}." + exit 1 + fi + - uses: pnpm/action-setup@v2 with: version: 8 @@ -25,13 +40,7 @@ jobs: - name: Run tests run: pnpm test - - name: Create .npmrc - run: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc - - name: Publish env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access public - - - name: Delete .npmrc - run: rm .npmrc + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access=public --tag=${{ steps.get-package.outputs.tag }} diff --git a/.gitignore b/.gitignore index bec69bd..08b6b92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .idea -.vscode coverage dist node_modules diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8ee72f4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "editor.tabCompletion": "on", + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "typescript.tsdk": "node_modules/typescript/lib", + "cSpell.words": ["mailgun", "typestyle"] +} diff --git a/package.json b/package.json index 48b88f8..0a2ece6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@barinbritva/add-to-calendar", - "version": "1.3.1", + "version": "1.3.2@next", "keywords": [ "event", "add", diff --git a/src/Generator/Office365.ts b/src/Generator/Office365.ts index 68de31a..f0464f9 100644 --- a/src/Generator/Office365.ts +++ b/src/Generator/Office365.ts @@ -1,5 +1,5 @@ import {Outlook} from './Outlook'; export class Office365 extends Outlook { - protected urlBase = 'https://outlook.office.com/calendar/0/deeplink/compose'; + protected urlBase = 'https://outlook.office.com/calendar/deeplink/compose'; } diff --git a/src/Generator/Outlook.ts b/src/Generator/Outlook.ts index 302028a..ca23f5d 100644 --- a/src/Generator/Outlook.ts +++ b/src/Generator/Outlook.ts @@ -16,7 +16,7 @@ interface QueryParameters extends QueryObject { } export class Outlook extends UrlGenerator { - protected urlBase = 'https://outlook.live.com/calendar/0/deeplink/compose'; + protected urlBase = 'https://outlook.live.com/calendar/deeplink/compose'; protected convertEventToQueryObject(event: Event): QueryParameters { return {