Skip to content

Commit

Permalink
Merge pull request #253 from jnsgruk/automation-uplift
Browse files Browse the repository at this point in the history
ci: update to use latest CI patterns
  • Loading branch information
merlijn-sebrechts authored Jan 15, 2024
2 parents 4a4e043 + 037bd48 commit 1f0a6dd
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 101 deletions.
20 changes: 0 additions & 20 deletions .build-trigger.txt

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every month
interval: "monthly"
File renamed without changes.
27 changes: 0 additions & 27 deletions .github/workflows/build-prs.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/promote-to-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Promote

on:
issue_comment:
types:
- created

permissions:
issues: write

jobs:
promote:
name: ⬆️ Promote to stable
environment: "Candidate Branch"
runs-on: ubuntu-latest
if: |
( !github.event.issue.pull_request )
&& contains(github.event.comment.body, '/promote ')
&& contains(github.event.*.labels.*.name, 'testing')
steps:
- name: ⬆️ Promote to stable
uses: snapcrafters/ci/promote-to-stable@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
store-token: ${{ secrets.SNAP_STORE_STABLE }}
17 changes: 17 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Pull Request

on:
pull_request:
branches: [ "**" ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: 🧪 Build snap on amd64
runs-on: ubuntu-latest
steps:
- name: 🧪 Build snap on amd64
uses: snapcrafters/ci/test-snap-build@main
72 changes: 72 additions & 0 deletions .github/workflows/release-to-candidate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
# Run the workflow each time new commits are pushed to the candidate branch.
push:
branches: [ "candidate" ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
issues: write

jobs:
get-architectures:
name: 🖥 Get snap architectures
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.get-architectures.outputs.architectures }}
architectures-list: ${{ steps.get-architectures.outputs.architectures-list }}
steps:
- name: 🖥 Get snap architectures
id: get-architectures
uses: snapcrafters/ci/get-architectures@main

release:
name: 🚢 Release to latest/candidate
needs: get-architectures
runs-on: ubuntu-latest
environment: "Candidate Branch"
strategy:
matrix:
architecture: ${{ fromJSON(needs.get-architectures.outputs.architectures-list) }}
steps:
- name: 🚢 Release to latest/candidate
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: ${{ matrix.architecture }}
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
repo-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}

call-for-testing:
name: 📣 Create call for testing
needs: [release, get-architectures]
environment: "Candidate Branch"
runs-on: ubuntu-latest
outputs:
issue-number: ${{ steps.issue.outputs.issue-number }}
steps:
- name: 📣 Create call for testing
id: issue
uses: snapcrafters/ci/call-for-testing@main
with:
architectures: ${{ needs.get-architectures.outputs.architectures }}
github-token: ${{ secrets.GITHUB_TOKEN }}

screenshots:
name: 📸 Gather screenshots
needs: call-for-testing
environment: "Candidate Branch"
runs-on: ubuntu-latest
steps:
- name: 📸 Gather screenshots
uses: snapcrafters/ci/get-screenshots@main
with:
issue-number: ${{ needs.call-for-testing.outputs.issue-number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
screenshots-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
27 changes: 27 additions & 0 deletions .github/workflows/sync-version-with-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update

on:
# Runs at 10:00 UTC every day
schedule:
- cron: '0 10 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
sync:
name: 🔄 Sync version with upstream
environment: "Candidate Branch"
runs-on: ubuntu-latest
steps:
- name: 🔄 Sync version with upstream
uses: snapcrafters/ci/sync-version@main
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
update-script: |
VERSION=$(curl -s https://www.gimp.org/ | grep -Po "span id='ver'>\K[^<]+")
sed -i 's/^\(version: \).*$/\1'"$VERSION"'/' snap/snapcraft.yaml
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ prime
__pycache__
*.pyc

.bzr
.bzr

# Snapcraft remote-build logs
gimp_*.txt
121 changes: 68 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,80 @@
distributions.</p>

<p align="center">
<a href="https://build.snapcraft.io/user/snapcrafters/gimp"><img src="https://build.snapcraft.io/badge/snapcrafters/gimp.svg" alt="Snap Status"></a>
<a href="https://snapcraft.io/gimp"><img src="https://snapcraft.io/gimp/badge.svg" alt="Snap Status"></a>
<a href="https://github.com/snapcrafters/gimp/actions/workflows/sync-version-with-upstream.yml"><img src="https://github.com/snapcrafters/gimp/actions/workflows/sync-version-with-upstream.yml/badge.svg"></a>
<a href="https://github.com/snapcrafters/gimp/actions/workflows/release-to-candidate.yaml"><img src="https://github.com/snapcrafters/gimp/actions/workflows/release-to-candidate.yaml/badge.svg"></a>
<a href="https://github.com/snapcrafters/gimp/actions/workflows/promote-to-stable.yml"><img src="https://github.com/snapcrafters/gimp/actions/workflows/promote-to-stable.yml/badge.svg"></a>
</p>

## Install

sudo snap install gimp
```shell
snap install gimp
```

([Don't have snapd installed?](https://snapcraft.io/docs/core/install))

![GIMP](screenshot.png?raw=true "GIMP")

<p align="center">Published for <img src="https://raw.githubusercontent.com/anythingcodes/slack-emoji-for-techies/gh-pages/emoji/tux.png" align="top" width="24" /> with :gift_heart: by Snapcrafters</p>

## Remaining tasks

Snapcrafters ([join us](https://forum.snapcraft.io/t/join-snapcrafters/1325))
are working to land snap install documentation and
the [snapcraft.yaml](https://github.com/snapcrafters/fork-and-rename-me/blob/master/snap/snapcraft.yaml)
upstream so GIMP can authoritatively publish future releases.

- [x] Fork the [Snapcrafters template](https://github.com/snapcrafters/fork-and-rename-me) repository to your own GitHub account.
- If you have already forked the Snapcrafter template to your account and want to create another snap, you'll need to use GitHub's [Import repository](https://github.com/new/import) feature because you can only fork a repository once.
- [x] Rename the forked Snapcrafters template repository
- [x] Update logos and references to `[Project]` and `[my-snap-name]`
- [x] Create a snap that runs in `devmode`
- [x] Register the snap in the store, **using the preferred upstream name**
- [x] Add a screenshot to this `README.md`
- [x] Publish the `devmode` snap in the Snap store edge channel
- [x] Add install instructions to this `README.md`
- [x] Update snap store metadata, icons and screenshots
- [x] Convert the snap to `strict` confinement, or `classic` confinement if it qualifies
- [x] Publish the confined snap in the Snap store beta channel
- [x] Update the install instructions in this `README.md`
- [x] Post a call for testing on the [Snapcraft Forum](https://forum.snapcraft.io) - [link](https://forum.snapcraft.io/t/call-for-testing-gimp/1281)
- [x] Ask a [Snapcrafters admin](https://github.com/orgs/snapcrafters/people?query=%20role%3Aowner) to fork your repo into github.com/snapcrafters, transfer the snap name from you to snapcrafters, and configure the repo for automatic publishing into edge on commit
- [x] Add the provided Snapcraft build badge to this `README.md`
- [x] Publish the snap in the Snap store stable channel
- [x] Update the install instructions in this `README.md`
- [x] Post an announcement in the [Snapcraft Forum](https://forum.snapcraft.io) - [link](https://forum.snapcraft.io/t/gimp-snap-pushed-to-stable-channel/1619)
- [ ] Submit a pull request or patch upstream that adds snap install documentation - [link]()
- [ ] Submit a pull request or patch upstream that adds the `snapcraft.yaml` and any required assets/launchers - [link]()
- [ ] Add upstream contact information to the `README.md`
- If upstream accept the PR:
- [ ] Request upstream create a Snap store account
- [ ] Contact the Snap Advocacy team to request the snap be transferred to upstream
- [ ] Ask the Snap Advocacy team to celebrate the snap - [link]()

If you have any questions, [post in the Snapcraft forum](https://forum.snapcraft.io).

## The Snapcrafters

| [![Dani Llewellyn](https://gravatar.com/avatar/c77d9922c44ee0a34b8cabc4029b5082/?s=128)](https://github.com/diddledani/) |
| :---: |
| [Dani Llewellyn](https://github.com/diddledani/) |

<!-- Uncomment and modify this when you have upstream contacts
## Upstream
| [![Upstream Name](http://gravatar.com/avatar/bc0bced65e963eb5c3a16cab8b004431?s=128)](https://github.com/upstreamname) |
| :---: |
| [Upstream Name](https://github.com/upstreamname) |
-->
## How to contribute to this snap

Thanks for your interest! Below you find instructions to help you contribute to this snap.

The general workflow is to submit pull requests that merges your changes into the `candidate` branch here on GitHub. Once the pull request has been merged, a GitHub action will automatically build the snap and publish it to the `candidate` channel in the Snap Store. Once the snap has been tested thoroughly, we promote it to the `stable` channel so all our users get it!

### Initial setup

If this is your first time contributing to this snap, you first need to set up your own fork of this repository.

1. [Fork the repository](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) into your own GitHub namespace.
2. [Clone your fork](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository), so that you have it on your local computer.
3. Configure your local repo. To make things a bit more intuitive, we will rename your fork's remote to `myfork`, and add the snapcrafters repo as `snapcrafters`.

```shell
git remote rename origin myfork
git remote add snapcrafters https://github.com/snapcrafters/gimp.git
git fetch --all
```

### Submitting changes in a pull request

Once you're all setup for contributing, keep in mind that you want the git information to be all up-to-date. So if you haven't "fetched" all changes in a while, start with that:

```shell
git fetch --all -p
```

Now that your git metadata has been updated you are ready to create a bugfix branch, make your changes, and open a pull request.

1. All pull requests should go to the stable branch so create your branch as a copy of the stable branch:

```shell
git checkout -b my-bugfix-branch snapcrafters/candidate
```

2. Make your desired changes and build a snap locally for testing:

```shell
snapcraft --use-lxd
```

3. After you are happy with your changes, commit them and push them to your fork so they are available on GitHub:

```shell
git commit -a
git push -u myfork my-bugfix-branch
```

4. Then, [open up a pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) from your `my-bugfix-branch` to the `snapcrafters/candidate` branch.
5. Once you've opened the pull request, it will automatically trigger the build-test action that will launch a build of the snap. You can watch the progress of the snap build from your pull request (Show all checks -> Details). Once the snap build has completed, you can find the built snap (to test with) under "Artifacts".
6. Someone from the team will review the open pull request and either merge it or start a discussion with you with additional changes or clarification needed.
7. Once the pull request has been merged into the stable branch, a GitHub action will rebuild the snap using your changes and publish it to the [Snap Store](https://snapcraft.io/gimp) into the `candidate` channel. After sufficient testing of the snap from the candidate channel, one of the maintainers or administrators will promote the snap to the stable branch in the Snap Store.
## Maintainers
- [@lucyllewy](https://github.com/lucyllewy/)
## License
- The license of both the build files in this repository is [MIT](https://github.com/snapcrafters/gimp/blob/main/LICENSE)

0 comments on commit 1f0a6dd

Please sign in to comment.