Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
keichan34 committed Sep 3, 2024
2 parents d289849 + 60785f5 commit b4212d0
Show file tree
Hide file tree
Showing 31 changed files with 797 additions and 140 deletions.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Launch Checklist

<!-- Thanks for the PR! Feel free to add or remove items from the checklist. -->


- [ ] Briefly describe the changes in this PR.
- [ ] Link to related issues.
- [ ] Include before/after visuals or gifs if this PR includes visual changes.
- [ ] Write tests for all new functionality.
- [ ] Add an entry to `CHANGELOG.md` under the `## main` section.

52 changes: 0 additions & 52 deletions .github/workflows/ci-desktop.yml

This file was deleted.

30 changes: 12 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,45 +54,39 @@ jobs:
- run: npm ci
- run: npm run build
- name: artifacts/maputnik
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: maputnik
path: dist

# Build and upload desktop CLI artifacts
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ^1.19.x
go-version: ^1.23.x
cache-dependency-path: desktop/go.sum
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
repository: maputnik/desktop
ref: master
path: ./src/github.com/maputnik/desktop/

- name: Make
run: cd src/github.com/maputnik/desktop/ && make
- name: Build desktop artifacts
run: npm run build-desktop

- name: Artifacts/linux
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: maputnik-linux
path: ./src/github.com/maputnik/desktop/bin/linux/
path: ./desktop/bin/linux/

- name: Artifacts/darwin
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: maputnik-darwin
path: ./src/github.com/maputnik/desktop/bin/darwin/
path: ./desktop/bin/darwin/

- name: Artifacts/windows
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: maputnik-windows
path: ./src/github.com/maputnik/desktop/bin/windows/
path: ./desktop/bin/windows/

e2e-tests:
name: "E2E tests using ${{ matrix.browser }}"
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/create-bump-version-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create bump version PR

on:
workflow_dispatch:
inputs:
version:
description: Version to change to.
required: true
type: string

jobs:
bump-version-pr:
name: Bump version PR
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Bump version
run: |
npm version --commit-hooks false --git-tag-version false ${{ inputs.version }}
./build/bump-version-changelog.js ${{ inputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Bump version to ${{ inputs.version }}
branch: bump-version-to-${{ inputs.version }}
title: Bump version to ${{ inputs.version }}
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release

on:
push:
branches: [main]
workflow_dispatch:

jobs:
release-check:
name: Check if version changed
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

outputs:
publish: ${{ steps.check.outputs.changed }}

release:
name: Release
needs: release-check
if: ${{ needs.release-check.outputs.publish == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"

- name: Set up Go for desktop build
uses: actions/setup-go@v5
with:
go-version: ^1.23.x
cache-dependency-path: desktop/go.sum
id: go

- name: Get version
id: package-version
uses: martinbeentjes/[email protected]

- name: Install
run: npm ci

- name: Build
run: |
npm run build-desktop
- name: Tag commit and push
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.package-version.outputs.current-version }}

- name: Create Archives
run: |
zip -r "desktop-${{ steps.package-version.outputs.current-version }}" desktop/bin/
- name: Build Release Notes
id: release_notes
run: |
RELEASE_NOTES_PATH="${PWD}/release_notes.txt"
./build/release-notes.js > ${RELEASE_NOTES_PATH}
echo "release_notes=${RELEASE_NOTES_PATH}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_regular_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
bodyFile: ${{ steps.release_notes.outputs.release_notes }}
artifacts: "desktop-${{ steps.package-version.outputs.current-version }}.zip"
allowUpdates: true
draft: false
prerelease: false

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ node_modules
public
/errorShots
/old
/build
/cypress/screenshots
/dist/
/desktop/version.go

# IDE
.vscode/
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## main

### ✨ Features and improvements
- _...Add new stuff here..._

### 🐞 Bug fixes
- _...Add new stuff here..._

## 2.1.1

### ✨ Features and improvements

- Add GitHub workflows for releasing new versions
- Update desktop build to pull from this repo (#922)

## 2.0.0

- Update MapLibre to version 4 (#872)
- Start continuous deployment of maputnik website

## 1.7.0

- See release notes at https://maputnik.github.io/blog/2020/04/23/release-v1.7.0

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Maputnik is written in typescript and is using [React](https://github.com/facebo

We ensure building and developing Maputnik works with the [current active LTS Node.js version and above](https://github.com/nodejs/Release#release-schedule).

Check out our [Internationalization guide](./src/locales/README.md) for UI text related changes.

### Getting Involved
Join the #maplibre or #maputnik slack channel at OSMUS: get an invite at https://slack.openstreetmap.us/ Read the the below guide in order to get familiar with how we do things around here.

Expand Down Expand Up @@ -98,6 +100,16 @@ You can also see the tests as they run or select which suites to run by executin
npm run cy:open
```

## Release process

1. Review [`CHANGELOG.md`](/CHANGELOG.md)
- Double-check that all changes included in the release are appropriately documented.
- To-be-released changes should be under the "main" header.
- Commit any final changes to the changelog.
2. Run [Create bump version PR](https://github.com/maplibre/maputnik/actions/workflows/create-bump-version-pr.yml) by manual workflow dispatch and set the version number in the input. This will create a PR that changes the changelog and `package.json` file to review and merge.
3. Once merged, an automatic process will kick in and creates a GitHub release and uploads release assets.


## Sponsors

Thanks to the supporters of the **[Kickstarter campaign](https://www.kickstarter.com/projects/174808720/maputnik-visual-map-editor-for-mapbox-gl)**. This project would not be possible without these commercial and individual sponsors.
Expand Down
11 changes: 11 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build Scripts

This folder holds common build scripts used by some of the Github workflows.

The scripts are borrowed from [maplibre/maplibre-gl-js](https://github.com/maplibre/maplibre-gl-js/tree/bc70bc559cea5c987fa1b79fd44766cef68bbe28/build).

## Generate Release Notes

`bump-version-changelog.js` Used to update the changelog with the current notes, and set up a space for new notes

`release-notes.js` Used to generate release notes when releasing a new version
29 changes: 29 additions & 0 deletions build/bump-version-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node

/**
* This script updates the changelog.md file with the version given in the arguments
* It replaces ## main with ## <version>
* Removes _...Add new stuff here..._
* And adds on top a ## main with add stuff here.
*
* Copied from maplibre/maplibre-gl-js
* https://github.com/maplibre/maplibre-gl-js/blob/bc70bc559cea5c987fa1b79fd44766cef68bbe28/build/release-notes.js
*/

import * as fs from 'fs';

const changelogPath = 'CHANGELOG.md';
let changelog = fs.readFileSync(changelogPath, 'utf8');
changelog = changelog.replace('## main', `## ${process.argv[2]}`);
changelog = changelog.replaceAll('- _...Add new stuff here..._\n', '');
changelog = `## main
### ✨ Features and improvements
- _...Add new stuff here..._
### 🐞 Bug fixes
- _...Add new stuff here..._
` + changelog;

fs.writeFileSync(changelogPath, changelog, 'utf8');
Loading

0 comments on commit b4212d0

Please sign in to comment.