Skip to content

Packager

Packager #7

Workflow file for this run

name: Packager
on:
workflow_dispatch:
inputs:
name:
description: Extension name
type: choice
required: true
options:
- wikibase
- visualeditor
ref:
description: Branch ref
default: REL1_39
type: string
required: true
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Store timestamp
run: echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
- name: Set archive name
run: echo "ARCHIVE_NAME=${{ github.event.inputs.name }}-${{ env.TIMESTAMP }}-${{ inputs.ref }}.tar.gz" >> $GITHUB_ENV
- name: Check out extension
uses: actions/checkout@v3
with:
submodules: true
repository: wikimedia/mediawiki-extensions-${{ github.event.inputs.name }}
path: ./repos/extension
ref: ${{ inputs.ref }}
# Fetching submodules may fail if "fetch-depth" is too shallow
fetch-depth: 3
- name: Remove .git related files
run: rm -rf .git .gitignore .gitmodules
working-directory: ./repos/extension
- name: Check out this repository
uses: actions/checkout@v3
with:
path: ./repos/release
# Requires "Read and write permissions" in Actions > General > Workflow permissions
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a Wikibase archive file
run: tar -czvf ./../release/${{ env.ARCHIVE_NAME }} ./
working-directory: ./repos/extension
- name: Commit and push archive
uses: EndBug/add-and-commit@v9
with:
cwd: ./repos/release
message: Add ${{ env.ARCHIVE_NAME }}
default_author: github_actions
push: true