Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce community plugin reusable action workflows #40

Merged
merged 1 commit into from
Apr 11, 2024
Merged
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
47 changes: 47 additions & 0 deletions .github/workflows/community-plugin-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
workflow_call:
inputs:
golang-version:
default: "1.21"
description: |
Set the version for golang
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: cd/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: cd/setup-plugin-environment
uses: mattermost/actions/plugin-ci/setup@main
with:
golang-version: ${{ inputs.golang-version }}

- name: cd/build-plugin
uses: mattermost/actions/plugin-ci/build@main

release-github:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: cd/checkout-repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: "0"

- name: cd/download-artifact
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: dist
path: dist

- name: ci/publish-release
working-directory: dist
run: |
gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file release-notes.md *.tar.gz
Comment on lines +44 to +47
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test this job using the webex plugin and it failed with (See https://github.com/mattermost/mattermost-plugin-webex/actions/runs/8660349876/job/23748214542)

gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable. Example:
  env:
    GH_TOKEN: ${{ github.token }}

Could you please look into that?

68 changes: 68 additions & 0 deletions .github/workflows/community-plugin-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
workflow_call:
inputs:
golangci-lint-version:
default: "v1.55.2"
description: |
Set the version for golangci-lint
required: false
type: string

golang-version:
default: "1.21"
description: |
Set the version for golang
required: false
type: string

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: ci/setup
uses: mattermost/actions/plugin-ci/setup@main
with:
golangci-lint-version: ${{ inputs.golangci-lint-version }}
golang-version: ${{ inputs.golang-version }}

- name: ci/lint
uses: mattermost/actions/plugin-ci/lint@main

test:
runs-on: ubuntu-latest
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: ci/setup
uses: mattermost/actions/plugin-ci/setup@main
with:
golangci-lint-version: ${{ inputs.golangci-lint-version }}
golang-version: ${{ inputs.golang-version }}

- name: ci/test
uses: mattermost/actions/plugin-ci/test@main

build:
runs-on: ubuntu-latest
steps:
- name: ci/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: ci/setup
uses: mattermost/actions/plugin-ci/setup@main
with:
golang-version: ${{ inputs.golang-version }}
golangci-lint-version: ${{ inputs.golangci-lint-version }}

- name: ci/build
uses: mattermost/actions/plugin-ci/build@main