Skip to content

Commit e428e82

Browse files
committed
Add doc on releases
1 parent 51ff565 commit e428e82

File tree

2 files changed

+74
-1
lines changed

2 files changed

+74
-1
lines changed

General/GithubActions.md

+74-1
Original file line numberDiff line numberDiff line change
@@ -779,12 +779,85 @@ Once this is done, each commit on master will result on updating the assets of t
779779

780780
![Screenshot of contunious release](GithubActions_continuous.png)
781781

782+
## Save releases artifacts
782783

784+
We have seen how to save the last artifact of a branch in a `continuous` release, but another case needs to be taken into account: the real releases.
785+
786+
It is useful when we release a project to save a Pharo image of this project with the version of the release.
787+
788+
This can be done with a new workflow file that will target realeses:
789+
790+
```yml
791+
name: Release
792+
793+
env:
794+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
795+
796+
on:
797+
release:
798+
types: [created, edited]
799+
800+
jobs:
801+
build:
802+
runs-on: ubuntu-latest
803+
env:
804+
PROJECT_NAME: MyProject-${{ matrix.smalltalk }}
805+
strategy:
806+
matrix:
807+
smalltalk: [ Pharo64-10, Pharo64-11 ]
808+
name: ${{ matrix.smalltalk }}
809+
steps:
810+
- uses: actions/checkout@v2
811+
- uses: hpi-swa/setup-smalltalkCI@v1
812+
with:
813+
smalltalk-version: ${{ matrix.smalltalk }}
814+
- run: smalltalkci -s ${{ matrix.smalltalk }}
815+
shell: bash
816+
timeout-minutes: 15
817+
818+
# Here we zip the result of the build to be able to keep the artefacts
819+
- name: package
820+
run: |
821+
mv /home/runner/.smalltalkCI/_builds/* .
822+
mv TravisCI.image $PROJECT_NAME.image
823+
mv TravisCI.changes $PROJECT_NAME.changes
824+
echo ${${{ matrix.smalltalk }}} | sed -e 's/.*\-//g ; s/\..*//g ; s/$/0/' > pharo.version
825+
zip -r $PROJECT_NAME.zip $PROJECT_NAME.image $PROJECT_NAME.changes *.sources pharo.version
826+
ls
827+
828+
- name: Release
829+
uses: softprops/action-gh-release@v1
830+
with:
831+
files: ${{ env.PROJECT_NAME }}.zip
832+
```
833+
834+
This file looks a lot like the one we wrote in the previous section.
835+
836+
I few changes are to be noted. The is the name of the workflow to identify it easily in the Actions tab of Github.
837+
The second is the target to build only on releases.
838+
839+
```yml
840+
on:
841+
release:
842+
types: [created, edited]
843+
```
844+
845+
And the last change is the action used after creating our Pharo archive.
846+
847+
```yml
848+
- name: Release
849+
uses: softprops/action-gh-release@v1
850+
with:
851+
files: ${{ env.PROJECT_NAME }}.zip
852+
```
853+
854+
This action will add the files matching the $files: property to the assets of the release.
855+
856+
![Screenshot of releases](GithubActions_releases.png)
783857

784858

785859

786860
TODO:
787-
- Releases
788861
- GitBridge
789862
- Complete example
790863
- Add to Pharo Launcher

General/GithubActions_releases.png

75.7 KB
Loading

0 commit comments

Comments
 (0)