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
@@ -69,21 +71,10 @@ jobs:
6971 repo : anchore/syft
7072 platform : linux
7173 arch : amd64
72- # tag: the latest one, so we can catch changes
7374
7475 - name : Setup skopeo
7576 run : sudo apt update && sudo apt-get -y install skopeo
7677
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-
8778 - name : Install project modules
8879 run : npm ci
8980
10495 with :
10596 python-version : ' 3.9'
10697 cache : ' pip'
98+
10799 - name : get Python location
108100 id : python-location
109101 run : |
@@ -122,32 +114,10 @@ jobs:
122114 echo "Running Again Integration tests =>"
123115 npm run integration-tests
124116
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- })
117+ publish-prerelease :
118+ needs : test
119+ uses : ./.github/workflows/release.yml
120+ with :
121+ version_type : prerelease
122+ secrets :
123+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments