2020 - " .github/workflows/stage.yml"
2121 - " docker-image/**"
2222
23+ permissions :
24+ contents : write
25+ id-token : write
26+
2327jobs :
24- stage :
28+ test :
2529 runs-on : ubuntu-latest
26- # Branches that starts with `release/` shouldn't trigger this workflow, as these are triggering the release workflow.
2730 if : github.repository_owner == 'guacsec' && github.event.pull_request.merged == true && !startsWith(github.head_ref, 'release/')
28- environment : staging
29- name : Stage the project
31+ name : Test before staging
3032 steps :
3133 - name : Checkout sources
3234 uses : actions/checkout@v4
3840 with :
3941 node-version : 18
4042 cache : npm
43+ registry-url : ' https://registry.npmjs.org'
4144
4245 - name : Enable Corepack
4346 run : corepack enable
@@ -69,21 +72,10 @@ jobs:
6972 repo : anchore/syft
7073 platform : linux
7174 arch : amd64
72- # tag: the latest one, so we can catch changes
7375
7476 - name : Setup skopeo
7577 run : sudo apt update && sudo apt-get -y install skopeo
7678
77- - name : Configure git
78- run : |
79- git config user.name "${{ github.actor }}"
80- git config user.email "${{ github.actor }}@users.noreply.github.com"
81-
82- - name : Update package with new version
83- id : bump
84- run : |
85- echo "version=$(npm version prerelease --no-git-tag-version --preid ea)" >> "$GITHUB_OUTPUT"
86-
8779 - name : Install project modules
8880 run : npm ci
8981
10496 with :
10597 python-version : ' 3.9'
10698 cache : ' pip'
99+
107100 - name : get Python location
108101 id : python-location
109102 run : |
@@ -122,32 +115,8 @@ jobs:
122115 echo "Running Again Integration tests =>"
123116 npm run integration-tests
124117
125- - name : Publish package
126- env :
127- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
128- run : npm publish
129-
130- - name : Commit and push package modifications
131- run : |
132- git add package.json
133- git add package-lock.json
134- git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]"
135- git push
136-
137- - name : Create and push new tag
138- run : |
139- git tag ${{ steps.bump.outputs.version }} -m "${{ steps.bump.outputs.version }}"
140- git push origin ${{ steps.bump.outputs.version }}
141-
142- - name : Create a release
143- uses : actions/github-script@v6.4.1
144- with :
145- github-token : ${{ secrets.GITHUB_TOKEN }}
146- script : |
147- const repo_name = context.payload.repository.full_name
148- const response = await github.request('POST /repos/' + repo_name + '/releases', {
149- tag_name: '${{ steps.bump.outputs.version }}',
150- name: '${{ steps.bump.outputs.version }}',
151- prerelease: true,
152- generate_release_notes: true
153- })
118+ publish-prerelease :
119+ needs : test
120+ uses : ./.github/workflows/release.yml
121+ with :
122+ version_type : prerelease
0 commit comments