tauri/.github/workflows/covector-version-or-publish.yml

110 lines
4.2 KiB
YAML
Raw Normal View History

name: version or publish
on:
push:
branches:
- dev
jobs:
version-or-publish:
runs-on: ubuntu-latest
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
- name: cargo login
run: cargo login ${{ secrets.crate_token }}
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: covector version
uses: jbolda/covector/packages/action@covector-v0
id: covector
with:
command: 'version-or-publish'
createRelease: true
- name: Create Pull Request With Versions Bumped
if: ${{ steps.covector.outputs.command }} == 'version'
uses: tauri-apps/create-pull-request@v2.8.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
title: Apply Version Updates From Current Changes
commit-message: "apply version updates"
labels: "version updates"
body: ${{ steps.covector.outputs.change }}
dump-job-context:
runs-on: ubuntu-latest
needs: version-or-publish
steps:
- name: dump all output
env:
OUTPUT_CONTEXT: ${{ toJson(needs.version-or-publish.outputs) }}
run: echo "$OUTPUT_CONTEXT"
- name: dump covector output
env:
COVECTOR_CONTEXT: ${{ toJson(needs.version-or-publish.outputs.change) }}
run: echo "$COVECTOR_CONTEXT"
- name: test successfulPublish
if: ${{ needs.version-or-publish.outputs.successfulPublish }} == 'true'
run: echo this should be skipped
- run: echo ::set-env name=PUBLISHED::$(jq '.${{ matrix.package.name }}.command' ${{ needs.version-or-publish.outputs.change }})
- run: echo ::set-env name=PACKAGE_VERSION::$(jq '.${{ matrix.package.name }}.pkg.pkgFile.version' ${{ needs.version-or-publish.outputs.change }})
- name: test published false
if: env.PUBLISHED != 'false'
run: echo published
- name: test published start
if: startsWith(env.PUBLISHED, 'parse error') != true
run: echo published
- name: test pkg version
if: startsWith(env.PACKAGE_VERSION, 'parse error') != true
run: echo published
tangle:
runs-on: ubuntu-latest
needs: [version-or-publish, dump-job-context]
if: false && ${{ needs.version-or-publish.outputs.covector.successfulPublish }} == 'true'
strategy:
fail-fast: false
matrix:
package:
- name: tauri.js
registryName: tauri
- name: tauri-bundler
registryName: tauri-bundler
- name: tauri-utils
registryName: tauri-utils
- name: tauri-api
registryName: tauri-api
- name: tauri-updater
registryName: tauri-updater
- name: tauri-core
registryName: tauri
steps:
- uses: actions/checkout@v2
- run: echo ::set-env name=PUBLISHED::$(jq '.${{ matrix.package.name }}.command' ${{ needs.version-or-publish.outputs.covector.change }})
- run: echo ::set-env name=PACKAGE_VERSION::$(jq '.${{ matrix.package.name }}.pkg.pkgFile.version' ${{ needs.version-or-publish.outputs.covector.change }})
- name: Tangle Release
if: env.PUBLISHED != 'false' && startsWith(env.PUBLISHED, 'parse error') != true && startsWith(env.PACKAGE_VERSION, 'parse error') != true
id: tangle_release
uses: iotaledger/gh-tangle-release@v0.6.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IOTA_SEED: ${{ secrets.IOTA_SEED }}
IOTA_NODE: "https://iotanode.us:14267"
with:
tag_name: ${{ matrix.package.name }}-v${{ env.PACKAGE_VERSION }}
comment: "Release ${{ matrix.package.name }} v${{ env.PACKAGE_VERSION }}"