Skip to content

Publish extensions πŸš€ #8

Publish extensions πŸš€

Publish extensions πŸš€ #8

Workflow file for this run

name: 'Publish extensions πŸš€'
on:
workflow_dispatch:
inputs:
environment:
description: 'The environment to publish the extensions to'
required: true
type: choice
options:
- 'testing'
- 'production'
target:
description: 'The target to publish the extensions to'
required: true
type: choice
options:
- 'trustedTesters'
- 'default'
workflow_call:
inputs:
environment:
type: string
required: true
target:
type: string
required: true
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
jobs:
deploy:
name: 'Publish ${{ inputs.environment }} extensions to ${{ inputs.target }}'
runs-on: ubuntu-22.04
environment:
name: ${{ inputs.environment }}
steps:
- uses: myparcelnl/actions/setup-git-credentials@v4
id: credentials
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.credentials.outputs.token }}
- uses: myparcelnl/actions/yarn-install@v4
with:
node-version: ${{ vars.NODE_VERSION }}
- uses: myparcelnl/actions/semantic-release@v4
name: 'Determine new version'
if: inputs.environment == 'production'
id: prerelease
with:
semantic-release-args: --debug
token: ${{ steps.credentials.outputs.token }}
dry-run: true
###
# This is also done by semantic-release itself, but we want to know if the build step passes before running
# semantic-release. The new version needs to be in the build, so we need to update it before building.
###
- name: 'Update version in package.json'
if: inputs.environment == 'production' && steps.prerelease.outputs.released == 'true'
env:
VERSION: ${{ steps.prerelease.outputs.version }}
shell: bash
#language=bash
run: |
npm version --no-git-tag-version "$VERSION"
- uses: ./.github/actions/build
# - uses: myparcelnl/actions/semantic-release@v4
# if: inputs.environment == 'production' && steps.prerelease.outputs.released == 'true'
# id: release
# with:
# token: ${{ steps.credentials.outputs.token }}
# write-summary: true
#
# - name: 'Prepare'
# id: prepare
# env:
# IS_PRODUCTION: ${{ inputs.environment == 'production' }}
# shell: bash
# # language=bash
# run: |
# if [ $IS_PRODUCTION == true ]; then
# echo "zip-path-myparcel=dist/myparcel.zip" >> $GITHUB_OUTPUT
# echo "zip-path-flespakket=dist/flespakket.zip" >> $GITHUB_OUTPUT
# echo "zip-path-sendmyparcel=dist/sendmyparcel.zip" >> $GITHUB_OUTPUT
# else
# echo "zip-path-myparcel=dist/myparcel-testing.zip" >> $GITHUB_OUTPUT
# echo "zip-path-flespakket=dist/flespakket-testing.zip" >> $GITHUB_OUTPUT
# echo "zip-path-sendmyparcel=dist/sendmyparcel-testing.zip" >> $GITHUB_OUTPUT
# fi
#
# - name: 'Publish MyParcel extension'
# uses: mnao305/[email protected]
# with:
# file-path: ${{ steps.prepare.outputs.zip-path-myparcel }}
# publish: true
# publish-target: ${{ inputs.target }}
# extension-id: ${{ vars.EXTENSION_ID_MYPARCEL }}
# client-id: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
# client-secret: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
# refresh-token: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
#
# - name: 'Publish Flespakket testing extension'
# uses: mnao305/[email protected]
# with:
# file-path: ${{ steps.prepare.outputs.zip-path-flespakket }}
# publish: true
# publish-target: ${{ inputs.target }}
# extension-id: ${{ vars.EXTENSION_ID_FLESPAKKET }}
# client-id: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
# client-secret: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
# refresh-token: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
#
# - name: 'Publish SendMyParcel testing extension'
# uses: mnao305/[email protected]
# with:
# file-path: ${{ steps.prepare.outputs.zip-path-sendmyparcel }}
# publish: true
# publish-target: ${{ inputs.target }}
# extension-id: ${{ vars.EXTENSION_ID_SENDMYPARCEL }}
# client-id: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
# client-secret: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
# refresh-token: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}