diff --git a/.github/release-template.md b/.github/release-template.md new file mode 100644 index 00000000000..ed53a0124da --- /dev/null +++ b/.github/release-template.md @@ -0,0 +1,18 @@ +This week's push hero is @{{GITHUB_USER}} + +Latest Release: [{{LATEST_TAG}}]({{LAST_RELEASE_URL}}) + +## Blockers: + +## Cherry-picks: + + + +## Before we push: + +## Before we start: + +## Before we promote: + +## After we're done: diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000000..f0633633c47 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,11 @@ +changelog: + categories: + - title: Notable things shipping + labels: + - '*' + exclude: + labels: + - dependencies + - title: Dependendabots + labels: + - dependencies diff --git a/.github/workflows/draft_release.yml b/.github/workflows/draft_release.yml new file mode 100644 index 00000000000..16052551cc4 --- /dev/null +++ b/.github/workflows/draft_release.yml @@ -0,0 +1,74 @@ +name: Draft Release + +on: + workflow_dispatch: + inputs: + tag: + description: 'Release date YYYY.MM.DD Also used to generate the tag name.' + required: true + pull_request: + +jobs: + draft_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Create Release Draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + # Format current date as YYYY.MM.DD + + if [[ "${{ github.event_name}}" == 'workflow_dispatch' ]]; then + tag="${{ github.event.inputs.tag }}" + else + tag=$(date +'%Y.%m.%d') + fi + + #Validate the tag is formatted correctly YYYY.MM.DD or YYYY.MM.DD-rcX + # where rcX is a whole number greater than zero + if [[ ! $tag =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}(-rc[0-9]+)?$ ]]; then + echo "Invalid tag format. Must be YYYY.MM.DD or YYYY.MM.DD-rcX" + exit 1 + fi + + # Verify that a release with this tag does not already exist + if gh release view $tag &> /dev/null; then + echo "Release $tag-next already exists" + exit 1 + fi + + # Get the latest release tag + latest_release=$( + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/mozilla/addons-server/releases/latest + ) + + latest_tag=$(echo $latest_release | jq -r '.tag_name') + latest_release_url=$(echo $latest_release | jq -r '.html_url') + + cat <