diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml deleted file mode 100644 index 7546d144..00000000 --- a/.github/workflows/continuous.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Development - -on: - push: - branches: - - development - # This will be triggered only for development branch - schedule: - - cron: '0 0 * * *' - -jobs: - -# Read the content of the files pharo-versions.json and moose-version.json. - get-versions: - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.read-file.outputs.versions }} - steps: - - uses: actions/checkout@v3 - - name: Read file - id: read-file - run: | - VERSIONS=$(cat $GITHUB_WORKSPACE/.github/workflows/versions.json) - echo "versions=$VERSIONS" >> $GITHUB_OUTPUT - - build: - runs-on: ubuntu-latest - needs: get-versions - env: - PROJECT_NAME: ${{ fromJSON(needs.get-versions.outputs.versions).moose-name }} - strategy: - fail-fast: false - matrix: - smalltalk: ${{ fromJSON(needs.get-versions.outputs.versions).pharo-versions }} - name: ${{ matrix.smalltalk }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Option fetching all commits - - uses: hpi-swa/setup-smalltalkCI@v1 - with: - smalltalk-image: ${{ matrix.smalltalk }} - - run: smalltalkci -s ${{ matrix.smalltalk }} - shell: bash - timeout-minutes: 15 - - - name: set-version - run: | - ls -l $SMALLTALK_CI_VM - $SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval --save "MooseVersion current commitHash: '$GITHUB_SHA'. (Smalltalk tools toolNamed: #mooseWelcome) closePharoWelcomeThenOpen" - - - name: rename - run: | - mv $SMALLTALK_CI_BUILD/* . - mv TravisCI.image $PROJECT_NAME-${{ matrix.smalltalk }}.image - mv TravisCI.changes $PROJECT_NAME-${{ matrix.smalltalk }}.changes - echo ${${{ matrix.smalltalk }}} | sed -e 's/.*\-//g ; s/\..*//g ; s/$/0/' > pharo.version - # Remove every character before '-' ; Remove point and anything after it ; add a '0'. - # This pattern transforms as follow: 'Pharo64-9.0' --> '90' and 'Pharo64-10' --> '100'. - - - name: package - run: | - zip -r $PROJECT_NAME-${{ matrix.smalltalk }}.zip $PROJECT_NAME-${{ matrix.smalltalk }}.image $PROJECT_NAME-${{ matrix.smalltalk }}.changes *.sources pharo.version - ls - - name: Update release - uses: Xotl/cool-github-releases@v1 - with: - mode: update - replace_assets: true - tag_name: ${{ fromJSON(needs.get-versions.outputs.versions).release-tag }} - assets: ${{ env.PROJECT_NAME }}-${{ matrix.smalltalk }}.zip - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/get-versions.yml b/.github/workflows/get-versions.yml deleted file mode 100644 index 388e7ceb..00000000 --- a/.github/workflows/get-versions.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Get versions file contents - -# Read the content of the file versions.json. -# Output is a json string. - -on: - workflow_call: - inputs: - file-path: - required: true - type: string - outputs: - versions: - description: "Versions informations as a Json string" - value: ${{ jobs.get-versions.outputs.versions }} - -jobs: - get-versions: - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.read-file.outputs.versions }} - steps: - - uses: actions/checkout@v4 - - name: Read file - id: read-file - run: | - VERSIONS=$(cat ${{ inputs.file-path }}) - echo "versions=$VERSIONS" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e77d7a0e..8bbd5e6d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,71 +1,13 @@ -name: Stable +name: Build release on: release: types: [created, edited] jobs: - -# Read the content of the files pharo-versions.json and moose-version.json. - get-versions: - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.read-file.outputs.versions }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - name: Read file - id: read-file - run: | - VERSIONS=$(cat $GITHUB_WORKSPACE/.github/workflows/versions.json) - echo "versions=$VERSIONS" >> $GITHUB_OUTPUT - - - build: - runs-on: ubuntu-latest - needs: get-versions - env: - PROJECT_NAME: ${{ fromJSON(needs.get-versions.outputs.versions).moose-name }} - strategy: - fail-fast: false - matrix: - smalltalk: ${{ fromJSON(needs.get-versions.outputs.versions).pharo-versions }} - name: ${{ matrix.smalltalk }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Option fetching all commits - - uses: hpi-swa/setup-smalltalkCI@v1 - with: - smalltalk-image: ${{ matrix.smalltalk }} - - run: smalltalkci -s ${{ matrix.smalltalk }} - shell: bash - timeout-minutes: 15 - - - name: set-version - run: | - ls -l $SMALLTALK_CI_VM - $SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval --save "MooseVersion current commitHash: '$GITHUB_SHA'. (Smalltalk tools toolNamed: #mooseWelcome) closePharoWelcomeThenOpen" - - - name: Package - run: | - mv /home/runner/.smalltalkCI/_builds/* . - mv TravisCI.image $PROJECT_NAME-${{ matrix.smalltalk }}.image - mv TravisCI.changes $PROJECT_NAME-${{ matrix.smalltalk }}.changes - echo ${${{ matrix.smalltalk }}} | sed -e 's/.*\-//g ; s/\..*//g ; s/$/0/' > pharo.version - # Remove every character before '-' ; Remove point and anything after it ; add a '0'. - # This pattern transforms as follow: 'Pharo64-9.0' --> '90' and 'Pharo64-10' --> '100'. - - name: Zip package - run: | - zip -r $PROJECT_NAME-${{ matrix.smalltalk }}.zip $PROJECT_NAME-${{ matrix.smalltalk }}.image $PROJECT_NAME-${{ matrix.smalltalk }}.changes *.sources pharo.version - ls - - - name: Update release - uses: Xotl/cool-github-releases@v1 - with: - mode: update - replace_assets: true - tag_name: ${{ fromJSON(needs.get-versions.outputs.versions).release-tag }} - assets: ${{ env.PROJECT_NAME }}-${{ matrix.smalltalk }}.zip - github_token: ${{ secrets.GITHUB_TOKEN }} + run-tests-and-update-release: + name: Run tests and update release + uses: moosetechnology/.github/.github/workflows/test-and-release.yml@main + with: + pre-upload-script: "MooseVersion current commitHash: '$GITHUB_SHA'. (Smalltalk tools toolNamed: #mooseWelcome) closePharoWelcomeThenOpen" + release-tag: ${{ github.ref }} diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml new file mode 100644 index 00000000..3c53eee8 --- /dev/null +++ b/.github/workflows/test-and-release.yml @@ -0,0 +1,24 @@ +name: Development +run-name: >- + ${{ vars.BRANCHES_CONFIGURATION + && fromJSON(vars.BRANCHES_CONFIGURATION)[github.ref_name] + && fromJSON(vars.BRANCHES_CONFIGURATION)[github.ref_name].run-name + || github.ref_name }} #Dedicated name in the Repository variable OR branch name + +on: + push: + branches: + - development + - v10 + - v11 + schedule: + - cron: '0 0 * * *' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + run-tests-and-update-release: + name: Run tests and update release + uses: moosetechnology/.github/.github/workflows/test-and-release.yml@main + with: + pre-upload-script: "MooseVersion current commitHash: '$GITHUB_SHA'. (Smalltalk tools toolNamed: #mooseWelcome) closePharoWelcomeThenOpen" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95c5aafa..5c932b02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,30 +5,8 @@ on: types: [assigned, opened, synchronize, reopened] jobs: - -# Get the content of the file versions.json. It is interpreted as a json data in the next job. - get-versions: - uses: ./.github/workflows/get-versions.yml - with: - file-path: $GITHUB_WORKSPACE/.github/workflows/versions.json - -# Run tests on pharo versions described in the file pharo-versions.json - build: - runs-on: ubuntu-latest - needs: - - get-versions - strategy: - fail-fast: false - matrix: - smalltalk: ${{ fromJSON(needs.get-versions.outputs.versions).pharo-versions }} - name: ${{ matrix.smalltalk }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Option fetching all commits - - uses: hpi-swa/setup-smalltalkCI@v1 - with: - smalltalk-image: ${{ matrix.smalltalk }} - - run: smalltalkci -s ${{ matrix.smalltalk }} - shell: bash - timeout-minutes: 15 + run: + uses: moosetechnology/.github/.github/workflows/run-tests.yml@main + secrets: inherit + with: + create-artifact: true diff --git a/.github/workflows/versions.json b/.github/workflows/versions.json deleted file mode 100644 index 2ce909f5..00000000 --- a/.github/workflows/versions.json +++ /dev/null @@ -1 +0,0 @@ -{"moose-name":"Moose11-stable","pharo-versions":[ "Pharo64-11", "Pharo64-12" ],"release-tag":"v11.x.x"}