|
1 | | -name: Convert Markdown to PDF and Create Release |
| 1 | +name: Build and Release TCASVS |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
| 7 | + paths: |
| 8 | + - '5.0/**' |
| 9 | + - 'docker/**' |
| 10 | + - 'Makefile' |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - '5.0/**' |
| 14 | + - 'docker/**' |
| 15 | + - 'Makefile' |
7 | 16 |
|
8 | 17 | jobs: |
9 | 18 | build: |
10 | 19 | runs-on: ubuntu-latest |
| 20 | + permissions: |
| 21 | + contents: write |
| 22 | + packages: write |
11 | 23 |
|
12 | 24 | steps: |
13 | 25 | - name: Checkout repository |
14 | | - uses: actions/checkout@v6 |
| 26 | + uses: actions/checkout@v4 |
15 | 27 |
|
16 | | - - name: Set up Pandoc and jq |
17 | | - run: | |
18 | | - sudo apt-get update |
19 | | - sudo apt-get install -y pandoc texlive jq |
| 28 | + - name: Log in to GitHub Container Registry |
| 29 | + uses: docker/login-action@v3 |
| 30 | + with: |
| 31 | + registry: ghcr.io |
| 32 | + username: ${{ github.actor }} |
| 33 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + |
| 35 | + - name: Build (or pull) the document builder image |
| 36 | + run: docker pull ghcr.io/owasp/tcasvs/documentbuilder:latest || docker build --pull --tag ghcr.io/owasp/tcasvs/documentbuilder:latest ./docker |
| 37 | + |
| 38 | + - name: Verify requirements parse correctly |
| 39 | + run: make verify |
| 40 | + |
| 41 | + - name: Build all exports |
| 42 | + run: make 5.0 FORMATS=all |
20 | 43 |
|
21 | | - - name: Fetch the latest release |
| 44 | + - name: Upload build artifacts |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: tcasvs-5.0.0-outputs |
| 48 | + path: 5.0/dist/ |
| 49 | + |
| 50 | + - name: Fetch the latest release tag |
22 | 51 | id: fetch_latest_release |
| 52 | + if: github.event_name == 'push' |
23 | 53 | run: | |
24 | 54 | LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) |
25 | 55 | if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" == "null" ]; then |
26 | | - LATEST_TAG="v0.4.0" |
27 | | - fi |
28 | | - # using this to fake/bump versions to v1.0 |
29 | | - if [ "$LATEST_TAG" == "v0.4.0" ]; then |
30 | | - LATEST_TAG="v1.0" |
| 56 | + LATEST_TAG="v5.0.0" |
31 | 57 | fi |
32 | 58 | echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV |
33 | 59 |
|
34 | 60 | - name: Increment version |
35 | 61 | id: increment_version |
| 62 | + if: github.event_name == 'push' |
36 | 63 | run: | |
37 | 64 | LATEST_TAG=${{ env.LATEST_TAG }} |
38 | | - echo "Latest tag: $LATEST_TAG" |
39 | 65 | LATEST_VERSION=${LATEST_TAG#v} |
40 | | - IFS='.' read -r major minor <<< "$LATEST_VERSION" |
41 | | - NEW_VERSION="$major.$((minor + 1))" |
| 66 | + IFS='.' read -r major minor patch <<< "$LATEST_VERSION" |
| 67 | + NEW_VERSION="$major.$minor.$((patch + 1))" |
42 | 68 | NEW_TAG="v$NEW_VERSION" |
43 | | - echo "New version: $NEW_TAG" |
44 | 69 | echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV |
45 | 70 |
|
46 | | - - name: Concatenate and Convert Markdown to PDF |
47 | | - run: | |
48 | | - pandoc document/1.0/*.md -o TASVS-${{ env.NEW_TAG }}.pdf -V geometry:margin=2cm |
49 | | -
|
50 | 71 | - name: Create GitHub Release |
51 | 72 | id: create_release |
| 73 | + if: github.event_name == 'push' |
52 | 74 | uses: actions/create-release@v1 |
53 | 75 | env: |
54 | 76 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
55 | 77 | with: |
56 | 78 | tag_name: ${{ env.NEW_TAG }} |
57 | | - release_name: Release ${{ env.NEW_TAG }} |
| 79 | + release_name: TCASVS ${{ env.NEW_TAG }} |
58 | 80 | draft: false |
59 | 81 | prerelease: false |
60 | 82 |
|
61 | | - - name: Upload PDF to Release |
| 83 | + - name: Upload PDF |
| 84 | + if: github.event_name == 'push' |
62 | 85 | uses: actions/upload-release-asset@v1 |
63 | 86 | env: |
64 | 87 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
65 | 88 | with: |
66 | 89 | upload_url: ${{ steps.create_release.outputs.upload_url }} |
67 | | - asset_path: ./TASVS-${{ env.NEW_TAG }}.pdf |
68 | | - asset_name: TASVS-${{ env.NEW_TAG }}.pdf |
| 90 | + asset_path: ./5.0/dist/OWASP_Thick_Client_Application_Security_Verification_Standard_5.0.0_en.pdf |
| 91 | + asset_name: TCASVS-${{ env.NEW_TAG }}.pdf |
69 | 92 | asset_content_type: application/pdf |
| 93 | + |
| 94 | + - name: Upload DOCX |
| 95 | + if: github.event_name == 'push' |
| 96 | + uses: actions/upload-release-asset@v1 |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + with: |
| 100 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 101 | + asset_path: ./5.0/dist/OWASP_Thick_Client_Application_Security_Verification_Standard_5.0.0_en.docx |
| 102 | + asset_name: TCASVS-${{ env.NEW_TAG }}.docx |
| 103 | + asset_content_type: application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| 104 | + |
| 105 | + - name: Upload JSON |
| 106 | + if: github.event_name == 'push' |
| 107 | + uses: actions/upload-release-asset@v1 |
| 108 | + env: |
| 109 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 110 | + with: |
| 111 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 112 | + asset_path: ./5.0/dist/OWASP_Thick_Client_Application_Security_Verification_Standard_5.0.0_en.json |
| 113 | + asset_name: TCASVS-${{ env.NEW_TAG }}.json |
| 114 | + asset_content_type: application/json |
| 115 | + |
| 116 | + - name: Upload CSV |
| 117 | + if: github.event_name == 'push' |
| 118 | + uses: actions/upload-release-asset@v1 |
| 119 | + env: |
| 120 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 121 | + with: |
| 122 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 123 | + asset_path: ./5.0/dist/OWASP_Thick_Client_Application_Security_Verification_Standard_5.0.0_en.csv |
| 124 | + asset_name: TCASVS-${{ env.NEW_TAG }}.csv |
| 125 | + asset_content_type: text/csv |
| 126 | + |
| 127 | + - name: Upload CycloneDX |
| 128 | + if: github.event_name == 'push' |
| 129 | + uses: actions/upload-release-asset@v1 |
| 130 | + env: |
| 131 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 132 | + with: |
| 133 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 134 | + asset_path: ./5.0/dist/OWASP_Thick_Client_Application_Security_Verification_Standard_5.0.0_en.cdx.json |
| 135 | + asset_name: TCASVS-${{ env.NEW_TAG }}.cdx.json |
| 136 | + asset_content_type: application/json |
0 commit comments