2020-07-19 23:50:56 +03:00
|
|
|
name: version or publish
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
version-or-publish:
|
|
|
|
runs-on: ubuntu-latest
|
2020-07-20 08:19:35 +03:00
|
|
|
outputs:
|
|
|
|
change: ${{ steps.covector.outputs.change }}
|
|
|
|
commandRan: ${{ steps.covector.outputs.commandRan }}
|
|
|
|
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
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'
|
2020-07-20 07:34:16 +03:00
|
|
|
createRelease: true
|
2020-07-19 23:33:12 +03:00
|
|
|
- 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 }}
|
|
|
|
|
2020-07-20 07:34:16 +03:00
|
|
|
dump-job-context:
|
2020-07-19 23:33:12 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: version-or-publish
|
2020-07-20 07:34:16 +03:00
|
|
|
steps:
|
|
|
|
- name: dump all output
|
|
|
|
env:
|
|
|
|
OUTPUT_CONTEXT: ${{ toJson(needs.version-or-publish.outputs) }}
|
|
|
|
run: echo "$OUTPUT_CONTEXT"
|
|
|
|
- name: dump covector output
|
|
|
|
env:
|
2020-07-20 08:19:35 +03:00
|
|
|
COVECTOR_CONTEXT: ${{ toJson(needs.version-or-publish.outputs.change) }}
|
2020-07-20 07:34:16 +03:00
|
|
|
run: echo "$COVECTOR_CONTEXT"
|
|
|
|
- name: test successfulPublish
|
2020-07-20 08:19:35 +03:00
|
|
|
if: ${{ needs.version-or-publish.outputs.successfulPublish }} == 'true'
|
2020-07-20 07:34:16 +03:00
|
|
|
run: echo this should be skipped
|
2020-07-20 08:19:35 +03:00
|
|
|
- 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 }})
|
2020-07-20 07:34:16 +03:00
|
|
|
- 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'
|
2020-07-19 23:33:12 +03:00
|
|
|
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
|
2020-07-20 07:34:16 +03:00
|
|
|
if: env.PUBLISHED != 'false' && startsWith(env.PUBLISHED, 'parse error') != true && startsWith(env.PACKAGE_VERSION, 'parse error') != true
|
2020-07-19 23:33:12 +03:00
|
|
|
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 }}
|
2020-07-20 07:34:16 +03:00
|
|
|
comment: "Release ${{ matrix.package.name }} v${{ env.PACKAGE_VERSION }}"
|