Skip to content

Create Tag and Publish to pub.dev #21

Create Tag and Publish to pub.dev

Create Tag and Publish to pub.dev #21

Workflow file for this run

name: Create Tag and Publish to pub.dev
on:
workflow_run:
workflows: ["Trigger Create Tag and Publish Workflow on PR Merge", "Check Version"]
types:
- completed
jobs:
placeholder-job:
runs-on: ubuntu-latest
steps:
- name: Placeholder Step
run: echo "This is a placeholder job"
create-tag-and-publish:
permissions:
repository-projects: write
packages: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
needs: [placeholder-job, trigger_next_action, trigger_create_tag_and_publish]
if: env.TRIGGER_NEXT_ACTION == 'true' && env.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true'

Check failure on line 27 in .github/workflows/create_tag.yml

View workflow run for this annotation

GitHub Actions / Create Tag and Publish to pub.dev

Invalid workflow file

The workflow is not valid. .github/workflows/create_tag.yml (Line: 27, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.TRIGGER_NEXT_ACTION == 'true' && env.TRIGGER_CREATE_TAG_AND_PUBLISH == 'true'
steps:
- uses: actions/checkout@v3
- name: Get version
id: yq
uses: mikefarah/yq@master
with:
cmd: yq -r '.version' 'pubspec.yaml'
- name: Print version
run: echo ${{ steps.yq.outputs.result }}
- name: Create tag
uses: actions/github-script@v3
id: tagCreate
env:
TAG: 'v${{ steps.yq.outputs.result }}'
with:
github-token: ${{ github.token }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.yq.outputs.result }}",
sha: context.sha
})
- name: Print tag update
run: echo ${{ steps.tagCreate.outputs.result }}
- name: Publish
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Flutter Version
run: flutter --version
- name: Publish to Dart Package
uses: k-paxian/dart-package-publisher@v1.5.1
with:
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
flutter: true
skipTests: true