fix(imap-append): ZMS-276: imap append improve logging add new fields… #279
This file contains hidden or 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
on: | |
push: | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
PACKAGE_NAME: ${{ github.event.repository.name }} | |
name: release | |
jobs: | |
release_please: | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
runs-on: ubuntu-latest | |
outputs: | |
major: ${{ steps.release.outputs.major }} | |
minor: ${{ steps.release.outputs.minor }} | |
patch: ${{ steps.release.outputs.patch }} | |
release_created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: node | |
package-name: ${{env.NPM_MODULE_NAME}} | |
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]' | |
# The logic below handles the npm publication: | |
- uses: actions/checkout@v4 | |
# these if statements ensure that a publication only occurs when | |
# a new release is created: | |
if: ${{ steps.release.outputs.release_created }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
if: ${{ steps.release.outputs.release_created }} | |
- run: npm ci | |
if: ${{ steps.release.outputs.release_created }} | |
- run: npm publish --provenance --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
if: ${{ steps.release.outputs.release_created }} | |
publish_docker: | |
name: Create and publish a Docker image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
needs: release_please | |
if: ${{needs.release_please.outputs.release_created}} | |
steps: | |
- run: echo version v${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: 'arm64' | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/arm64,linux/amd64 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=auto | |
tags: | | |
type=semver,pattern={{version}},value=v${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} | |
type=semver,pattern={{major}}.{{minor}},value=v${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} | |
type=semver,pattern={{major}},value=v${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
platforms: ${{ steps.buildx.outputs.platforms }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | |
subject-digest: ${{ steps.push.outputs.digest }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
publish_artifacts: | |
name: Package and upload release artifacts | |
runs-on: ubuntu-latest | |
needs: release_please | |
if: ${{needs.release_please.outputs.release_created}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm install --omit=dev | |
- name: Move files to temporary directory | |
run: | | |
mkdir -p ${{ runner.temp }}/release_build | |
cp -R . ${{ runner.temp }}/release_build/ | |
- name: Create zip archive | |
run: | | |
# Create a zip archive excluding .git directory | |
ROOT_DIR=$(pwd) | |
cd ${{ runner.temp }}/release_build | |
zip -r $ROOT_DIR/${{env.PACKAGE_NAME}}-${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}}.zip . -x "*.git" "*.git/*" | |
cd $ROOT_DIR | |
- name: Create tar.gz archive | |
run: | | |
# Create a tar.gz archive excluding .git directory | |
tar --exclude='.git' --exclude='.git/*' -czf ${{env.PACKAGE_NAME}}-${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}}.tar.gz -C ${{ runner.temp }}/release_build/ . | |
- name: Upload artifacts to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
${{env.PACKAGE_NAME}}-${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}}.zip | |
${{env.PACKAGE_NAME}}-${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}}.tar.gz | |
tag_name: v${{needs.release_please.outputs.major}}.${{needs.release_please.outputs.minor}}.${{needs.release_please.outputs.patch}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |