Skip to content

Commit

Permalink
Update Pharo versions
Browse files Browse the repository at this point in the history
Remove TravisCI support
Improve Pharo GH Actions
  • Loading branch information
gcotelli committed Sep 8, 2023
1 parent 3ab275e commit 716522f
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 82 deletions.
4 changes: 1 addition & 3 deletions .usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ usage() {

#shellcheck disable=SC2086
cat << EOF
Usage: $(basename $0) -p PROJECT_NAME [-r REPO_NAME] [-o OWNER] [-c COPYRIGHT_HOLDER] [-d DEFAULT_BRANCH] [-b BUILD_SERVICE]
Usage: $(basename $0) -p PROJECT_NAME [-r REPO_NAME] [-o OWNER] [-c COPYRIGHT_HOLDER] [-d DEFAULT_BRANCH]
This program will create a project template using ba-st conventions.
Options:
-p PROJECT_NAME Used for the name of the project.
-r REPO_NAME Used for the code repository. Defaults to PROJECT_NAME.
-o OWNER Used as the repository owner. Defaults to ba-st.
-c COPYRIGHT_HOLDER Used as the copyright holder in the license file. Defaults to Buenos Aires Smalltalk Contributors.
-d DEFAULT_BRANCH Used as the default branch name in the documentation templates. Defaults to release-candidate.
-b BUILD_SERVICE Used to configure the build service to use. Defaults to github.
The valid options are github (GitHub Actions) and travis (Travis CI).
-h Display this usage message and exit.
Example:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2021 Buenos Aires Smalltalk Contributors
Copyright (c) 2019-2023 Buenos Aires Smalltalk Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ The code is licensed under [MIT](LICENSE).
### Pre-Requisites

- Create your project in GitHub.
- Configure CI
- If you want to use GitHub Actions no further configuration is needed.
- If you want to use Travis CI:
- Login to [Travis CI](https://travis-ci.com) and enable the integration
against your new repo
- [Install the travis CLI](https://github.com/travis-ci/travis.rb#installation)
because you will need it to setup the releases key
- Configure Coverage
- If you want to use CodeCov login to [CodeCov](https://codecov.io/gh), enable
the GitHub integration and create a new secret in your repo (`CODECOV_TOKEN`)
Expand All @@ -44,9 +37,6 @@ The code is licensed under [MIT](LICENSE).
- Review the proposed files and adapt it to your own needs
- Clone your new repository
- Create a new branch called `release-candidate` : `git checkout -b release-candidate`
- If you're using Travis CI you can ease the releases configuration by using
`travis setup releases --com` on your repo and copying the encrypted key
to the proposed travis yml file
- Move the proposed file structure into your repo (keep an eye on the hidden files)
- Commit and push the changes to GitHub
- Go to the repo settings, set as default branch and protect the
Expand All @@ -58,13 +48,13 @@ The script will propose the following structure:

- `assets/` : Static resources
- `docs/` : Documentation
- `docs/README.md` : Documentation readme
- `docs/README.md` : Documentation README
- `docs/explanation` : [Explanations and discussions](https://documentation.divio.com/explanation/)
- `docs/how-to` : [How-to guides](https://documentation.divio.com/how-to-guides/)
- `docs/reference` : [Reference guides](https://documentation.divio.com/reference/)
- `docs/tutorial` : [Tutorials](https://documentation.divio.com/tutorials/)
- `source/` : Source Code
- `README.md` : Readme
- `README.md` : README
- `CONTRIBUTING.md` : Contribution Guidelines
- `LICENSE` : MIT License

Expand Down
25 changes: 6 additions & 19 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ REPO_OPTION=""
OWNER_OPTION=""
COPYRIGHT_HOLDER_OPTION=""
DEFAULT_BRANCH=""
BUILD_SERVICE_OPTION=""

# Parse command line options
while getopts "p:r:o:c:d:b:h" option; do
Expand All @@ -26,7 +25,6 @@ while getopts "p:r:o:c:d:b:h" option; do
o) OWNER_OPTION=$OPTARG ;;
c) COPYRIGHT_HOLDER_OPTION=$OPTARG ;;
d) DEFAULT_BRANCH=$OPTARG ;;
b) BUILD_SERVICE_OPTION=$OPTARG ;;
h) usage ;;
esac
done
Expand All @@ -40,11 +38,6 @@ readonly REPO_NAME="${REPO_OPTION:-$PROJECT_NAME}"
readonly OWNER="${OWNER_OPTION:-ba-st}"
readonly COPYRIGHT_HOLDER="${COPYRIGHT_HOLDER_OPTION:-"Buenos Aires Smalltalk Contributors"}"
readonly DEFAULT_BRANCH="${DEFAULT_BRANCH:-release-candidate}"
readonly BUILD_SERVICE="${BUILD_SERVICE_OPTION:-github}"

if [ "${BUILD_SERVICE}" != "github" ] && [ "${BUILD_SERVICE}" != "travis" ]; then
usage "Invalid build service. Valid options are github or travis."
fi

print_notice "Creating template for $PROJECT_NAME hosted at https://github.com/$OWNER/$REPO_NAME"

Expand Down Expand Up @@ -94,18 +87,12 @@ cp templates/.project "$EXPORT_LOCATION/.project"
cp templates/.gitattributes "$EXPORT_LOCATION/.gitattributes"
print_success " [OK]"

if [ "${BUILD_SERVICE}" == "github" ]; then
print_info " Copying GitHub Actions configuration..."
cp -r templates/.github "$EXPORT_LOCATION/.github"
mkdir "$EXPORT_LOCATION/.smalltalkci"
for filename in templates/.smalltalkci/*; do
sed "$REPLACE_TEMPLATE_VARS" "$filename" > "$EXPORT_LOCATION/.smalltalkci/$(basename "$filename")"
done
elif [ "${BUILD_SERVICE}" == "travis" ]; then
print_info " Copying Travis CI configuration..."
sed "$REPLACE_TEMPLATE_VARS" templates/.travis.yml > "$EXPORT_LOCATION/.travis.yml"
sed "$REPLACE_TEMPLATE_VARS" templates/.smalltalkci/unit-tests.ston > "$EXPORT_LOCATION/.smalltalk.ston"
fi
print_info " Copying GitHub Actions configuration..."
cp -r templates/.github "$EXPORT_LOCATION/.github"
mkdir "$EXPORT_LOCATION/.smalltalkci"
for filename in templates/.smalltalkci/*; do
sed "$REPLACE_TEMPLATE_VARS" "$filename" > "$EXPORT_LOCATION/.smalltalkci/$(basename "$filename")"
done
print_success " [OK]"

print_notice "Review the proposed files in the build directory and adapt it to your own needs"
9 changes: 6 additions & 3 deletions templates/.github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Markdown Lint
on: [push,pull_request,workflow_dispatch]
on:
- push
- pull_request
- workflow_dispatch
jobs:
remark-lint:
name: runner / markdownlint
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 1 addition & 4 deletions templates/.github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Release Notifications

on:
release:
types: [published]
on: workflow_dispatch

jobs:
notify:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
name: Baseline Groups
name: Pharo Loading Targets

on: [push,pull_request,workflow_dispatch]
on:
- push
- pull_request
- workflow_dispatch

jobs:
group-loading:
loading-targets:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0 ]
load-spec: [ deployment, dependent-sunit-extensions, tests, tools, development ]
name: ${{ matrix.smalltalk }} + ${{ matrix.load-spec }}
smalltalk:
- Pharo64-10
- Pharo64-11
load-target:
- development
- dependent-sunit-extensions
- deployment
- tests
- tools
name: Load ${{ matrix.load-target }} - ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load group in image
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/loading.${{ matrix.load-spec }}.ston
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/loading.${{ matrix.load-target }}.ston
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Unit Tests
name: Pharo Unit Tests

on: [push,pull_request,workflow_dispatch]
on:
- push
- pull_request
- workflow_dispatch

jobs:
build:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0 ]
name: ${{ matrix.smalltalk }}
smalltalk:
- Pharo64-10
- Pharo64-11
name: Unit Tests - ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
- name: Set up Smalltalk CI
Expand Down
20 changes: 0 additions & 20 deletions templates/.travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion templates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 {{COPYRIGHT_HOLDER}}
Copyright (c) 2023 {{COPYRIGHT_HOLDER}}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

What is this thing? “the motto”, the goals, the vision.

[![Unit Tests](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/unit-tests.yml/badge.svg)
[![Pharo Unit Tests](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/pharo-unit-tests.yml/badge.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/pharo-unit-tests.yml/badge.svg)
[![Coverage Status](https://codecov.io/github/{{OWNER}}/{{REPO_NAME}}/coverage.svg?branch={{DEFAULT_BRANCH}})](https://codecov.io/gh/{{OWNER}}/{{REPO_NAME}}/branch/{{DEFAULT_BRANCH}})
[![Baseline Groups](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/loading-groups.yml/badge.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/loading-groups.yml)
[![Pharo Loading Targets](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/pharo-loading-targets.yml/badge.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/pharo-loading-targets.yml)
[![Markdown Lint](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/markdown-lint.yml/badge.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/actions/workflows/markdown-lint.yml)

[![GitHub release](https://img.shields.io/github/release/{{OWNER}}/{{REPO_NAME}}.svg)](https://github.com/{{OWNER}}/{{REPO_NAME}}/releases/latest)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org)

Why would I care about this thing? When to use it? For whom is it designed?
When not to use it?
Expand All @@ -29,7 +29,7 @@ When not to use it?

## Installation

To load the project in a Pharo image follow this [instructions](docs/how-to/how-to-load-in-pharo.md).
To load the project in a Pharo image follow these [instructions](docs/how-to/how-to-load-in-pharo.md).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion templates/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Links to additional documentation.
To use the project as a dependency of your project, take a look at:

- [How to use {{PROJECT_NAME}} as a dependency](how-to/how-to-use-as-dependency-in-pharo.md)
- [Baseline groups reference](reference/Baseline-groups.md)
- [Loading targets reference](reference/loading-targets.md)
2 changes: 1 addition & 1 deletion templates/docs/how-to/how-to-load-in-pharo.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
6. Click *Ok*
7. Select the repository in the main Iceberg window
8. Open the contextual menu and select
*Metacello -> Install baseline of {{REPO_NAME}} ...*
*Metacello Install baseline of {{REPO_NAME}} ...*
9. Type `Development` and click *Ok*

> After Iceberg cloned a repository, it will be checked-out at the default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Baseline Groups
# Loading targets

## Pharo Baseline Groups

{{PROJECT_NAME}} includes the following groups in its Baseline that can be used as
loading targets:
Expand Down

0 comments on commit 716522f

Please sign in to comment.