Skip to content

Update files for new mattermost release v10.0.0 #177

Update files for new mattermost release v10.0.0

Update files for new mattermost release v10.0.0 #177

Workflow file for this run

name: Package and release
on:
push:
branches:
- main
- support-**
pull_request:
branches:
- main
- support-**
env:
DEBIAN_RELEASE: bookworm
DOCKER_PWD: /root
DOCKER_IMAGE: debian:${DEBIAN_RELEASE}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: arm
- os: linux
arch: arm64
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set environment from runtime properties
run: |
cat mattermost-release.txt >> $GITHUB_ENV
- name: Pull docker image
run: 'docker pull "${{ env.DOCKER_IMAGE }}"'
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: docker run --mount="type=bind,source=$PWD,destination=${{ env.DOCKER_PWD }}" --rm=true --tty=true --workdir="${{ env.DOCKER_PWD }}" -e DEBIAN_RELEASE -e MATTERMOST_VERSION -e MMCTL_RELEASE -e MM_FOCALBOARD_RELEASE -e GOOS -e GOARCH -e GO_VERSION "${{ env.DOCKER_IMAGE }}" ./build.sh
- name: Tag release
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref,'refs/heads/support-') }}
uses: actions/github-script@v7
# this throws an error if the tag already exists. can't find a way around that without writing our own Github REST client or forking github's scripts repo.
# would prefer to do this before any of these jobs run, but we need to know the mattermost version which only happens after a clone. could potentially
# setup a separate job which does clone + tag, but felt like this was "good enough" for now.
continue-on-error: true
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ env.MATTERMOST_VERSION }}',
sha: context.sha
})
- name: Create Github release
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref,'refs/heads/support-') }}
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GH_TOKEN }}
tag_name: ${{ env.MATTERMOST_VERSION }}
files: |
mattermost-${{ env.MATTERMOST_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
mattermost-${{ env.MATTERMOST_VERSION }}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz.sha512sum