Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/actions/release/bump-versions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,6 @@ runs:
command: install
args: -f --no-default-features --features "add set-version" --version ^0.8 cargo-edit

- name: Replace identity_iota version in Wasm bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/wasm
run: |
cargo add identity_iota@=${{ inputs.version }} --path=../../identity_iota

- name: Replace identity versions in stronghold nodejs bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/stronghold-nodejs
run: |
cargo add identity_core@=${{ inputs.version }} --path=../../identity_core
cargo add identity_iota_core@=${{ inputs.version }} --path=../../identity_iota_core
cargo add identity_account_storage@=${{ inputs.version }} --path=../../identity_account_storage

- name: Bump Rust crate versions
shell: bash
if: ${{inputs.release-target == 'rust'}}
Expand Down Expand Up @@ -75,6 +59,22 @@ runs:
run: |
cargo set-version ${{ inputs.version }}

- name: Replace identity_iota version in Wasm bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/wasm
run: |
cargo add identity_iota --path=../../identity_iota

- name: Replace identity versions in stronghold nodejs bindings
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: bindings/stronghold-nodejs
run: |
cargo add identity_core --path=../../identity_core
cargo add identity_iota_core --path=../../identity_iota_core
cargo add identity_account_storage --path=../../identity_account_storage

- name: Set up Node.js
uses: actions/setup-node@v2
if: ${{inputs.release-target == 'wasm'}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust-automatic-release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
call-create-release-workflow:
if: github.event.pull_request.merged == true
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-release.yml@dev
with:
changelog-config-path: ./.github/.github_changelog_generator
dev-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+-(dev)\.\d*$
main-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
pre-release-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+-(?<pre-release>\w+)\.\d+$
main-release-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
create-github-release: true
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/rust-create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ on:
description: 'Version to release Rust under (e.g. `1.2.3`)'
required: true
release-type:
description: Create a `dev` or `main` release. If `dev`, a `dev` postfix and auto-incrementing number will be added automatically (e.g. `1.2.3-dev.x`)'
description: Create a `main` or a pre-release. If anything other then `main` is selected, a postfix and auto-incrementing number will be added automatically (e.g. `1.2.3-dev.x`)'
type: choice
required: true
options:
- alpha
- beta
- rc
- dev
- main

jobs:
create-dev-release-pr:
if: github.event.inputs.release-type == 'dev'
if: github.event.inputs.release-type != 'main'
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@dev
with:
tag-prefix: v
tag-postfix: -dev.
tag-postfix: -${{ github.event.inputs.release-type }}.
tag-base: ${{ github.event.inputs.version }}
main-tag-regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
changelog-config-path: ./.github/.github_changelog_generator
Expand All @@ -32,7 +35,7 @@ jobs:
create-main-release-pr:
if: github.event.inputs.release-type == 'main'
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-main-release-pr.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-create-main-release-pr.yml@dev
with:
tag-prefix: v
tag-base: ${{ github.event.inputs.version }}
Expand Down
42 changes: 25 additions & 17 deletions .github/workflows/shared-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,30 @@ on:
description: "path to the changelog config"
required: true
type: string
main-tag-regex:
main-release-tag-regex:
description: "the regex to find all related main releases"
required: true
type: string
dev-tag-regex:
description: "the regex to find all related dev releases"
pre-release-tag-regex:
description: "the regex to find all related pre-releases. Must include a named capture group 'pre-release', which captures the pre-release version (e.g. 'alpha', 'beta', etc.)"
required: true
type: string
outputs:
is-release:
description: "is release"
value: ${{ jobs.build.outputs.is-release }}
is-dev-release:
description: "is dev release"
value: ${{ jobs.build.outputs.is-dev-release }}
is-pre-release:
description: "is pre-release"
value: ${{ jobs.build.outputs.is-pre-release }}
previous-version:
description: "tag of the previous version"
description: "tag of the previous version (e.g. '0.5.0')"
value: ${{ jobs.build.outputs.previous-version }}
current-version:
description: "tag of the current version"
description: "tag of the current version (e.g. '0.6.0')"
value: ${{ jobs.build.outputs.current-version }}
pre-release-identifier:
description: "identifier of the pre-release (e.g. 'alpha', 'beta', etc.)"
value: ${{ jobs.build.outputs.pre-release-identifier }}
secrets:
GPG_PRIVATE_KEY:
description: "GPG private key for signing commits and tags"
Expand All @@ -53,7 +56,8 @@ jobs:
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.determine-version.outputs.is-release }}
is-dev-release: ${{ steps.determine-version.outputs.is-dev-release }}
is-pre-release: ${{ steps.determine-version.outputs.is-pre-release }}
pre-release-identifier: ${{ steps.determine-version.outputs.pre-release-identifier }}
previous-version: ${{ steps.determine-version.outputs.previous-version }}
current-version: ${{ steps.determine-version.outputs.current-version }}
steps:
Expand All @@ -68,18 +72,19 @@ jobs:
run: |
BRANCHNAME=${{ github.head_ref }}
CURRENT_VERSION=${BRANCHNAME##*/}
if ! [[ $(echo $CURRENT_VERSION | grep -o -P '${{ inputs.dev-tag-regex }}') || $(echo $CURRENT_VERSION | grep -o -P '${{ inputs.main-tag-regex }}') ]]; then
if ! [[ $(echo $CURRENT_VERSION | grep -o -P '${{ inputs.pre-release-tag-regex }}') || $(echo $CURRENT_VERSION | grep -o -P '${{ inputs.main-release-tag-regex }}') ]]; then
exit 0
fi
IS_RELEASE=true
echo IS_RELEASE=$IS_RELEASE
echo IS_RELEASE=$IS_RELEASE >> $GITHUB_ENV
echo "::set-output name=is-release::$IS_RELEASE"
if [[ $(echo $CURRENT_VERSION | grep -w -P '${{ inputs.dev-tag-regex }}') ]]; then
IS_DEV_RELEASE=true
PREVIOUS_VERSION=$(git tag -l --sort=-version:refname --merged $(git log -n 1 refs/remotes/origin/$(git rev-parse --abbrev-ref HEAD) --pretty=format:"%H") | grep -w -P '${{ inputs.dev-tag-regex }}' | head -n 1)
if [[ $(echo $CURRENT_VERSION | grep -w -P '${{ inputs.pre-release-tag-regex }}') ]]; then
IS_PRE_RELEASE=true
PRE_RELEASE_IDENTIFIER=$(echo $CURRENT_VERSION | perl -pe '/${{ inputs.pre-release-tag-regex }}/; $_ = "$+{tag}\n"')
PREVIOUS_VERSION=$(git tag -l --sort=-version:refname --merged $(git log -n 1 refs/remotes/origin/$(git rev-parse --abbrev-ref HEAD) --pretty=format:"%H") | grep -w -P '${{ inputs.pre-release-tag-regex }}' | head -n 1)
else
PREVIOUS_VERSION=$(git tag -l --sort=-version:refname --merged $(git log -n 1 refs/remotes/origin/$(git rev-parse --abbrev-ref HEAD) --pretty=format:"%H") | grep -w -P '${{ inputs.main-tag-regex }}' | head -n 1)
PREVIOUS_VERSION=$(git tag -l --sort=-version:refname --merged $(git log -n 1 refs/remotes/origin/$(git rev-parse --abbrev-ref HEAD) --pretty=format:"%H") | grep -w -P '${{ inputs.main-release-tag-regex }}' | head -n 1)
fi

# create a list of tags that are unrelated to the current release
Expand All @@ -100,9 +105,12 @@ jobs:
EXCLUDE_ARG=$FIRST$SECOND
fi

echo IS_DEV_RELEASE=$IS_DEV_RELEASE
echo IS_DEV_RELEASE=$IS_DEV_RELEASE >> $GITHUB_ENV
echo "::set-output name=is-dev-release::$IS_DEV_RELEASE"
echo IS_PRE_RELEASE=$IS_PRE_RELEASE
echo IS_PRE_RELEASE=$IS_PRE_RELEASE >> $GITHUB_ENV
echo "::set-output name=is-pre-release::$IS_PRE_RELEASE"
echo PRE_RELEASE_IDENTIFIER=$PRE_RELEASE_IDENTIFIER
echo PRE_RELEASE_IDENTIFIER=$PRE_RELEASE_IDENTIFIER >> $GITHUB_ENV
echo "::set-output name=pre-release-identifier::$PRE_RELEASE_IDENTIFIER"
echo CURRENT_VERSION=$CURRENT_VERSION
echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV
echo "::set-output name=current-version::$CURRENT_VERSION"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/wasm-automatic-release-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
uses: iotaledger/identity.rs/.github/workflows/shared-release.yml@dev
with:
changelog-config-path: ./bindings/wasm/.github_changelog_generator
dev-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+-(dev)\.\d*$
main-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+$
pre-release-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+-(?<pre-release>\w+)\.\d+$
main-release-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+$
create-github-release: false
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand All @@ -26,7 +26,7 @@ jobs:
needs: call-create-release-workflow
if: ${{ needs.call-create-release-workflow.outputs.is-release }}
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-build-wasm.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-build-wasm.yml@dev
with:
output-artifact-name: identity-wasm-bindings-build

Expand All @@ -42,7 +42,7 @@ jobs:
with:
input-artifact-name: identity-wasm-bindings-build
npm-token: ${{ secrets.NPM_TOKEN }}
tag: ${{ needs.call-create-release-workflow.outputs.is-dev-release && 'dev' }}
tag: ${{ needs.call-create-release-workflow.outputs.is-pre-release && needs.call-create-release-workflow.outputs.pre-release-identifier }}

# build-stronghold-nodejs:
# needs: build-wasm
Expand All @@ -66,5 +66,5 @@ jobs:
# uses: './.github/actions/publish/publish-stronghold-nodejs'
# with:
# npm-token: ${{ secrets.NPM_TOKEN }}
# tag: ${{ needs.call-create-release-workflow.outputs.is-dev-release && 'dev' }}
# tag: ${{ needs.call-create-release-workflow.outputs.is-pre-release && needs.call-create-release-workflow.outputs.pre-release-identifier }}
# input-artifact-name: identity-stronghold-nodejs-bindings-build
17 changes: 10 additions & 7 deletions .github/workflows/wasm-create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ on:
description: 'Version to release Wasm under (e.g. `1.2.3`)'
required: true
release-type:
description: Create a `dev` or `main` release. If `dev`, a `dev` postfix and auto-incrementing number will be added automatically (e.g. `1.2.3-dev.x`)'
description: Create a `main` or a pre-release. If anything other then `main` is selected, a postfix and auto-incrementing number will be added automatically (e.g. `1.2.3-dev.x`)'
type: choice
required: true
options:
options:
- alpha
- beta
- rc
- dev
- main

jobs:
create-dev-release-pr:
if: github.event.inputs.release-type == 'dev'
if: github.event.inputs.release-type != 'main'
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-create-dev-release-pr.yml@dev
with:
tag-prefix: wasm-v
tag-postfix: -dev.
tag-postfix: -${{ github.event.inputs.release-type }}.
tag-base: ${{ github.event.inputs.version }}
main-tag-regex: ^wasm-v[0-9]+\.[0-9]+\.[0-9]+$
changelog-config-path: ./bindings/wasm/.github_changelog_generator
changelog-path: ./bindings/wasm/CHANGELOG.md
pr-body-text: On merge a `dev` release will be published to npm.
pr-body-text: On merge a non-main release will be published to npm.
release-target: wasm
secrets:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand All @@ -35,7 +38,7 @@ jobs:
create-main-release-pr:
if: github.event.inputs.release-type == 'main'
# owner/repository of workflow has to be static, see https://github.qkg1.topmunity/t/env-variables-in-uses/17466
uses: iotaledger/identity.rs/.github/workflows/shared-create-main-release-pr.yml@dev
uses: eike-hass/identity.rs/.github/workflows/shared-create-main-release-pr.yml@dev
with:
tag-prefix: wasm-v
tag-base: ${{ github.event.inputs.version }}
Expand Down
Loading